diff -N -r -U 5 ../gramofile-1.6.origCS/Makefile ./Makefile
--- ../gramofile-1.6.origCS/Makefile	Tue Mar 28 22:23:58 2000
+++ ./Makefile	Sat Oct 21 23:31:14 2000
@@ -6,11 +6,11 @@
         signpr_main.c signpr_infilenm.c signpr_outfilenm.c		\
         signpr_general.c signpr_median.c signpr_filtmenu.c signpr_wav.c	\
 	secshms.c playwav.c signpr_cmf.c signpr_mean.c signpr_doubmed.c	\
 	splashscr.c tracksplit.c tracksplit_filenm.c			\
         tracksplit_parammenu.c signpr_cmf2.c signpr_rms.c signpr_copy.c	\
-        signpr_exper.c endian.c signpr_mono.c signpr_l1fit.c
+        signpr_exper.c endian.c signpr_mono.c signpr_l1fit.c signpr_nor.c
 
 OBJS = $(SRCS:.c=.o)
 SHELL = /bin/sh
 
 CC = gcc
diff -N -r -U 5 ../gramofile-1.6.origCS/mainmenu.c ./mainmenu.c
--- ../gramofile-1.6.origCS/mainmenu.c	Tue Mar 28 23:07:25 2000
+++ ./mainmenu.c	Sat Oct 21 23:32:50 2000
@@ -191,11 +191,11 @@
 #define MAINMENU_OPTIONS 6
   char *menu_options[MAINMENU_OPTIONS] =
   {
     "Record audio to a sound file           ",
     "[Copy sound from an audio CD to a file]",
-    "Locate tracks                          ",
+    "Locate tracks and maximum sample value ",
     "Process the audio signal               ",
     "[Write an audio CD]                    ",
     "Play a sound file                      "};
 
   char *menu_helptext[MAINMENU_OPTIONS]
@@ -207,12 +207,12 @@
 
     "This option is not implemented yet. You can use the `cdda2wav' \
 or `cdparanoia' program to copy digital audio from a CD to a sound file \
 (.wav format) on the harddisk.",
 
-    "The starts and ends of tracks in a large sound file can be \
-detected automatically with this option. The `process signal' \
+    "The starts and ends of tracks and maximum sample values in a large sound \
+file can be detected automatically with this option. The `process signal' \
 option uses the resulting .tracks file to actually split tracks.",
 
     "With this option, the digital audio from a sound file on the harddisk \
 can be processed. For example, ticks may be filtered out. If track \
 separation points are computed (previous option), separate audio files \
diff -N -r -U 5 ../gramofile-1.6.origCS/signpr_general.c ./signpr_general.c
--- ../gramofile-1.6.origCS/signpr_general.c	Tue Mar 28 23:07:26 2000
+++ ./signpr_general.c	Sat Oct 21 23:29:19 2000
@@ -1,9 +1,11 @@
 /* General functions for signal processing
 
  * Copyright (C) 1998 J.A. Bezemer
  *
+ * Modified to include Normalize filter  - S.Deschenes
+ *
  * Licensed under the terms of the GNU General Public License.
  * ABSOLUTELY NO WARRANTY.
  * See the file `COPYING' in this directory.
  */
 
@@ -18,10 +20,11 @@
 #include "signpr_doubmed.h"
 #include "signpr_rms.h"
 #include "signpr_copy.h"
 #include "signpr_exper.h"
 #include "signpr_mono.h"
+#include "signpr_nor.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #ifndef OLD_CURSES
 #include <ncurses.h>
@@ -509,10 +512,18 @@
 		     COND_MEDIAN2_HELPTEXT);
 
   add_to_filterlist (filtlist,
 		     filtnumbers,
 		     helptexts,
+		     SIMPLE_NOR_FILTER,
+		     SIMPLE_NOR_NAME,
+		     SIMPLE_NOR_HELPTEXT);
+
+
+  add_to_filterlist (filtlist,
+		     filtnumbers,
+		     helptexts,
 		     EXPERIMENT_FILTER,
 		     EXPERIMENT_NAME,
 		     EXPERIMENT_HELPTEXT);
 
 }
@@ -561,10 +572,14 @@
 
       case EXPERIMENT_FILTER:
 	return experiment_filter (parampointerarray[filterno]);
 	break;
 
+      case SIMPLE_NOR_FILTER:
+	return simple_nor_filter (parampointerarray[filterno]);
+	break;
+
       default:
 	printf ("Error (get_sample_from_filter): wrong filter");
 	exit (2);
 	break;
       }
@@ -613,10 +628,14 @@
 
       case MONOIZE_FILTER:
 	init_monoize_filter (i, parampointerarray[i]);
 	break;
 
+      case SIMPLE_NOR_FILTER:
+	init_simple_nor_filter (i, parampointerarray[i]);
+	break;
+
       case EXPERIMENT_FILTER:
 	init_experiment_filter (i, parampointerarray[i]);
 	break;
 
       default:
@@ -669,10 +688,14 @@
 
       case MONOIZE_FILTER:
 	delete_monoize_filter (parampointerarray[i]);
 	break;
 
+      case SIMPLE_NOR_FILTER:
+	delete_simple_nor_filter (parampointerarray[i]);
+	break;
+
       case EXPERIMENT_FILTER:
 	delete_experiment_filter (parampointerarray[i]);
 	break;
 
       default:
@@ -722,10 +745,14 @@
 
     case MONOIZE_FILTER:
       monoize_param_defaults (parampointer);
       break;
 
+    case SIMPLE_NOR_FILTER:
+      simple_nor_param_defaults (parampointer);
+      break;
+
     case EXPERIMENT_FILTER:
       experiment_param_defaults (parampointer);
       break;
 
     default:
@@ -773,10 +800,14 @@
       copyonly_param_screen (parampointer);
       break;
 
     case MONOIZE_FILTER:
       monoize_param_screen (parampointer);
+      break;
+
+    case SIMPLE_NOR_FILTER:
+      simple_nor_param_screen (parampointer);
       break;
 
     case EXPERIMENT_FILTER:
       experiment_param_screen (parampointer);
       break;
diff -N -r -U 5 ../gramofile-1.6.origCS/signpr_general.h ./signpr_general.h
--- ../gramofile-1.6.origCS/signpr_general.h	Tue Mar 28 23:07:26 2000
+++ ./signpr_general.h	Sat Oct 21 23:47:36 2000
@@ -1,7 +1,9 @@
 /* General functions for signal processing - Header
 
+ * Modified to include Normalize filter  - S. Deschenes
+
  * Copyright (C) 1998 J.A. Bezemer
  *
  * Licensed under the terms of the GNU General Public License.
  * ABSOLUTELY NO WARRANTY.
  * See the file `COPYING' in this directory.
@@ -219,11 +221,16 @@
 #define MONOIZE_FILTER          8
 #define MONOIZE_NAME            "Convert to mono"
 #define MONOIZE_HELPTEXT        \
 "Average left & right signals."
 
-#define EXPERIMENT_FILTER	9
+#define SIMPLE_NOR_FILTER	9
+#define SIMPLE_NOR_NAME		"Simple Normalize Filter"
+#define SIMPLE_NOR_HELPTEXT	\
+"Increase or decrease signal."
+
+#define EXPERIMENT_FILTER	10
 #define EXPERIMENT_NAME		"Experimenting Filter"
 #define EXPERIMENT_HELPTEXT	\
 "The filter YOU are experimenting with (in signpr_exper.c)"
 
 
diff -N -r -U 5 ../gramofile-1.6.origCS/signpr_main.c ./signpr_main.c
--- ../gramofile-1.6.origCS/signpr_main.c	Tue Mar 28 23:07:26 2000
+++ ./signpr_main.c	Sat Oct 21 23:29:19 2000
@@ -279,11 +279,11 @@
   static char *filtlist_items[MAX_FILTERS + 10];
   static int filtnumbers[MAX_FILTERS + 10];
   static char *helptexts[MAX_FILTERS + 10];
   static scrollmenu_t selectedfilts;
   static char *selectedfilts_items[MAX_FILTERS];
-  static int usebeginendtime = 0, usetracktimes = 1;
+  static int usebeginendtime = 1, usetracktimes = 0;
   static double begintime = 0, endtime = 0;
 
   struct stat buf;
   int i;
   char *charptr;
diff -N -r -U 5 ../gramofile-1.6.origCS/signpr_nor.c ./signpr_nor.c
--- ../gramofile-1.6.origCS/signpr_nor.c	Thu Jan  1 01:00:00 1970
+++ ./signpr_nor.c	Sat Oct 21 23:57:24 2000
@@ -0,0 +1,251 @@
+/* Simple Normalize Filter
+
+ * By Sylvain Deschenes
+ *
+ * Licensed under the terms of the GNU General Public License.
+ * ABSOLUTELY NO WARRANTY.
+ * See the file `COPYING' in this directory.
+ */
+
+#include "signpr_nor.h"
+#include "signpr_general.h"
+#include "errorwindow.h"
+#include "stringinput.h"
+#include "buttons.h"
+#include "clrscr.h"
+#include "boxes.h"
+#include "helpline.h"
+#include <stdlib.h>
+#include <stdio.h>
+#ifndef OLD_CURSES
+#include <ncurses.h>
+#else
+#include <curses.h>
+#endif
+
+int i;
+long inpf;
+
+
+void
+simple_nor_param_defaults (parampointer_t parampointer)
+{
+  parampointer->postlength1 = 0;
+  parampointer->prelength1 = 0;
+}
+
+void
+simple_nor_param_screen (parampointer_t parampointer)
+{
+  stringinput_t norlengthstr;
+  button_t ok_button, cancel_button;
+  int dont_stop = TRUE;
+  int returnval = 0;
+  int focus = 0;
+  int in_ch;
+
+  long helplong;
+
+  char *helplines[3] =
+  {
+    " ^: more expansion.                    v: less expansion                       ",
+    " Discard changes.                                                              ",
+    " Accept changes.                                                               "};
+
+  norlengthstr.maxlen = 500;
+  norlengthstr.string = (char *) malloc (norlengthstr.maxlen *
+					 sizeof (char));
+  sprintf (norlengthstr.string, "%ld", 0);
+  norlengthstr.y = 6;
+  norlengthstr.x = 38;
+  norlengthstr.w = 15;
+  norlengthstr.cursorpos = strlen (norlengthstr.string);
+  norlengthstr.firstcharonscreen = 0;
+
+  ok_button.text = " OK ";
+  ok_button.y = 20;
+  ok_button.x = 71;
+  ok_button.selected = FALSE;
+
+  cancel_button.text = " Cancel ";
+  cancel_button.y = 20;
+  cancel_button.x = 5;
+  cancel_button.selected = FALSE;
+
+  clearscreen (SIGNPR_NOR_PARAMSCR_HEADERTEXT);
+
+  do
+    {
+      header (SIGNPR_NOR_PARAMSCR_HEADERTEXT);
+
+      if (focus == 1)
+	cancel_button.selected = TRUE;
+      else
+	cancel_button.selected = FALSE;
+
+      if (focus == 2)
+	ok_button.selected = TRUE;
+      else
+	ok_button.selected = FALSE;
+
+      mvprintw (3, 2,
+	 "Normalize filter - Increase or reduce signal by 0 to +/- 100 %%");
+
+      mvprintw (4, 2,
+		"Use TRACK file to find maximum sample value and apply appropriate factor");
+
+      stringinput_display (&norlengthstr);
+      mvprintw (norlengthstr.y, 2,
+		"Enter normalize factor:");
+
+      button_display (&cancel_button);
+      mybox (cancel_button.y - 1, cancel_button.x - 1,
+	     3, strlen (cancel_button.text) + 2);
+      button_display (&ok_button);
+      mybox (ok_button.y - 1, ok_button.x - 1,
+	     3, strlen (ok_button.text) + 2);
+
+      helpline (helplines[focus]);
+
+      if (focus == 0)
+	stringinput_display (&norlengthstr);
+      else
+	move (0, 79);
+
+      refresh ();
+
+      in_ch = getch ();
+
+      switch (focus)
+	{
+	case 0:		/* norlengthstr */
+	  stringinput_stdkeys (in_ch, &norlengthstr);
+	  if (in_ch == KEY_ENTER || in_ch == 13)
+	    {
+	      i = sscanf (norlengthstr.string, "%li", &helplong);
+
+	      /*if (i < 0 || helplong < 0)
+	         error_window ("A number between 0 and 100 must \
+	         be specified.");
+	         else
+	         { */
+	      inpf = helplong;
+	      focus = 2;
+	      /*} */
+	    }
+	  else
+	    switch (in_ch)
+	      {
+	      case KEY_UP:
+		focus--;
+		break;
+	      case KEY_DOWN:
+		focus++;
+		break;
+	      }
+	  break;
+
+	case 1:		/* Cancel */
+	  if (in_ch == KEY_ENTER || in_ch == 13)
+	    {
+	      returnval = 0;
+	      dont_stop = FALSE;
+	    }
+	  else
+	    switch (in_ch)
+	      {
+	      case KEY_LEFT:
+	      case KEY_UP:
+		focus--;
+		break;
+	      case KEY_RIGHT:
+	      case KEY_DOWN:
+		focus++;
+		break;
+	      }
+	  break;
+
+	case 2:		/* OK */
+	  if (in_ch == KEY_ENTER || in_ch == 13)
+	    {
+	      i = sscanf (norlengthstr.string, "%li", &helplong);
+	      /* if ( (abs) i < 0 || (abs) helplong < 0)
+	         {
+	         error_window ("A number between 0 and 100 must \
+	         be specified.");
+
+	         norlengthstr.cursorpos =
+	         strlen (norlengthstr.string);
+	         focus = 0;
+	         }
+	         else
+	         {  */
+	      inpf = helplong;
+	      dont_stop = FALSE;
+	      /*} */
+	    }
+	  else
+	    switch (in_ch)
+	      {
+	      case KEY_LEFT:
+	      case KEY_UP:
+		focus--;
+		break;
+	      case KEY_RIGHT:
+	      case KEY_DOWN:
+		focus++;
+		break;
+	      }
+	  break;
+	}
+
+      if (in_ch == 9)		/* TAB */
+	focus++;
+
+      if (in_ch == 27)
+	dont_stop = FALSE;
+
+      if (focus > 2)
+	focus -= 3;
+      if (focus < 0)
+	focus += 3;
+    }
+  while (dont_stop);
+
+  free (norlengthstr.string);
+}
+
+void
+init_simple_nor_filter (int filterno, parampointer_t parampointer)
+{
+  parampointer->buffer = init_buffer (0, 0);
+
+  parampointer->filterno = filterno;
+}
+
+void
+delete_simple_nor_filter (parampointer_t parampointer)
+{
+  delete_buffer (&parampointer->buffer);
+}
+
+
+sample_t
+simple_nor_filter (parampointer_t parampointer)
+{
+
+  sample_t sample;
+  double nfac;
+
+  advance_current_pos (&parampointer->buffer, parampointer->filterno);
+
+
+  sample = get_from_buffer (&parampointer->buffer, 0);
+
+  nfac = (double) 1 + (double) ((double) inpf / (double) 100);
+  sample.left = (signed short) ((double) sample.left * nfac);
+  sample.right = (signed short) ((double) sample.right * nfac);
+
+
+  return sample;
+}
diff -N -r -U 5 ../gramofile-1.6.origCS/signpr_nor.h ./signpr_nor.h
--- ../gramofile-1.6.origCS/signpr_nor.h	Thu Jan  1 01:00:00 1970
+++ ./signpr_nor.h	Sat Oct 21 23:57:35 2000
@@ -0,0 +1,29 @@
+/* Simple Normalize Filter - Header
+
+ * By Sylvain Deschenes
+ *
+ * Licensed under the terms of the GNU General Public License.
+ * ABSOLUTELY NO WARRANTY.
+ * See the file `COPYING' in this directory.
+ */
+
+#ifndef HAVE_SIGNPR_NOR_H
+#define HAVE_SIGNPR_NOR_H
+
+
+#include "signpr_general.h"
+
+#define SIGNPR_NOR_PARAMSCR_HEADERTEXT "Simple Normalize Filter - Parameters"
+
+void simple_nor_param_defaults (parampointer_t parampointer);
+
+void simple_nor_param_screen (parampointer_t parampointer);
+
+void init_simple_nor_filter (int filterno, parampointer_t parampointer);
+
+void delete_simple_nor_filter (parampointer_t parampointer);
+
+sample_t simple_nor_filter (parampointer_t parampointer);
+
+
+#endif /* HAVE_SIGNPR_NOR_H */
diff -N -r -U 5 ../gramofile-1.6.origCS/tracksplit.c ./tracksplit.c
--- ../gramofile-1.6.origCS/tracksplit.c	Tue Mar 28 23:07:26 2000
+++ ./tracksplit.c	Sat Oct 21 23:44:28 2000
@@ -1,9 +1,11 @@
 /* Determining Starts and Ends of Tracks
 
  * Copyright (C) 1998 J.A. Bezemer
  *
+ * Modified by S. Deschenes to report peak sample statistics
+ *
  * Licensed under the terms of the GNU General Public License.
  * ABSOLUTELY NO WARRANTY.
  * See the file `COPYING' in this directory.
  */
 
@@ -487,11 +489,11 @@
 tracksplit_main (char *startdir)
 {
   char filename[250];
 
   /* options menu defaults */
-  int make_use_rms = 1;
+  int make_use_rms = 0;
   int make_graphs = 0;
   long blocklen = 4410;
   int global_silence_factor = 150;
   int local_silence_threshold = 5;
   int min_silence_blocks = 20;
@@ -528,10 +530,18 @@
   double min_poss_threshold, max_poss_threshold;
   int compute_rms_now;
   long templong;
   int in_ch;
 
+  signed short leftvalue, rightvalue;
+  long sampleravge = 0;
+  long avgeleft = 0;
+  long avgeright = 0;
+  long samplelavge = 0;
+  signed short maxleft = 0;
+  signed short maxright = 0;
+
   filename[0] = '\0';
 
   if (!tracksplit_get_options (startdir, filename,
 			       &make_use_rms, &make_graphs, &blocklen,
 			       &global_silence_factor,
@@ -659,10 +669,30 @@
 	      {
 		sample = readsamplesource ();
 		sum_left += sample.left * (long) sample.left;
 		sum_right += sample.right * (long) sample.right;
 		/* (long) => faster & accurate */
+            
+            /* Code to check max sample */		
+		leftvalue=abs(sample.left);
+		if (leftvalue > maxleft) maxleft = leftvalue;
+		
+		rightvalue=abs(sample.right);
+		if (rightvalue > maxright) maxright = rightvalue;
+
+                samplelavge += leftvalue/328;
+                sampleravge += rightvalue/328;
+
+/*		if (leftvalue > 16383 || rightvalue > 16383)
+		  samplesabove50pct ++;
+		if (leftvalue > 29490 || rightvalue > 29490) 
+		  samplesabove90pct ++;
+		if (leftvalue > 32439 || rightvalue > 32439) 
+		  samplesabove99pct ++;
+		if (leftvalue > 32764 || rightvalue > 32764) 
+		  samplestooloud ++;
+*/
 		samples_read++;
 		total_samples_read++;
 	      }
 
 	  sum_left = sqrt (fabs (sum_left / samples_read));
@@ -680,10 +710,15 @@
 
 	  rmsarray[current_block] = sum_left;	/* store in array */
 
 	  current_block++;
 
+        /* Check average sample */
+        avgeleft = samplelavge/(total_samples_read);
+        avgeright = sampleravge/(total_samples_read);
+
+
 	  in_ch = getch ();	/* Check for keypress */
 	  if (in_ch == 27 || in_ch == 13 || in_ch == KEY_ENTER)
 	    {
 	      reset_prog_mode ();
 	      nodelay (stdscr, FALSE);
@@ -858,11 +893,28 @@
   fprintf (tempfile, "Local_silence_factor=%d\n",
 	   local_silence_threshold);
   fprintf (tempfile, "Min_silence_blocks=%d\n", min_silence_blocks);
   fprintf (tempfile, "Min_track_blocks=%d\n", min_track_blocks);
   fprintf (tempfile, "Extra_blocks_start=%d\n", extra_blocks_start);
-  fprintf (tempfile, "Extra_blocks_end=%d\n", extra_blocks_end);
+  fprintf (tempfile, "Extra_blocks_end=%d\n\n", extra_blocks_end);
+
+/* Print sample results */
+  fprintf (tempfile, "#Average Sample Size %% -> Left  : %d\n", avgeleft);
+  fprintf (tempfile, "#Average Sample Size %% -> Right : %d\n", avgeright);
+  fprintf (tempfile, "#Maximum Sample Value  -> Left  : %d\n", maxleft);
+  fprintf (tempfile, "#Maximum Sample Value  -> Right : %d\n", maxright);
+  fprintf (tempfile, "#Maximum Sample Size %% -> Left  : %d\n",
+                    (int)((double)((double) maxleft/(double) 32767)*(double) 100));
+  fprintf (tempfile, "#Maximum Sample Size %% -> Right : %d\n\n",
+                    (int)((double)((double) maxright/(double) 32767)*(double) 100));
+
+/*  fprintf (tempfile, "#Normalize Factor (90) -> Left  : %d\n", 
+                    (int)((double)((double) maxleft/(double) 32767)*(double) 100));
+  fprintf (tempfile, "#Normalize Faxtor (90) -> Right : %d\n\n", 
+                    (int)(((double)1-(double)((double)100/((double)((double) maxright/(double) 32767)*(double) 100))))*(double)100);
+*/
+
   fprintf (tempfile, "\
 \n\
 # Below are start/end times of tracks. These are used to create separate\n\
 # soundfiles during signal processing. You may modify the computed values\n\
 # if you disagree... The block-numbers are those used in the .med file.\n\
