1GramoFile - Gramophone records to CDs, Tick Reduction, Track Splitting 2Copyright (C) 1998 J.A. Bezemer 3 4This program is free software; you can redistribute it and/or modify it 5under the terms of the GNU General Public License as published by the Free 6Software Foundation; either version 2 of the License, or (at your option) 7any later version. 8 9This program is distributed in the hope that it will be useful, but 10WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12for more details. 13 14You should have received a copy of the GNU General Public License along 15with this program; if not, write to the Free Software Foundation, Inc., 16675 Mass Ave, Cambridge, MA 02139, USA. 17 18 19INTRODUCTION / OVERVIEW 20 21This is version 1.6 of GramoFile, released March 28, 2000. With this 22program you can record audio of (for example) gramophone records, process 23the signal and listen to the results. Because sound files of the 24.WAV-format are used, it is possible to exchange the files with many other 25programs. Cdrecord(1) can burn CD-Recordables of these, so you can make 26CDs with the music of your favorite records. The user interface of 27GramoFile has a windows-like look-and-feel, making it fairly easy to use. 28 29One of the most important parts of GramoFile is the ability to process 30digital audio signals. Through the application of several filters it is 31possible to accomplish a significant reduction of disturbances like ticks 32and scratches. These filters have been programmed in such a fashion that 33they can be applied in a random order (and multiple times) in a single 34run, thus evading the use of temporary files. There is a possibility of 35adjusting the properties of each filter independently, so in every 36situation an optimal result can be achieved. 37 38Another interesting feature is the track splitting. Just make one .wav file 39of an entire side of an record and GramoFile will detect where the individual 40tracks are located. This happens fully automatically, without need to set 41any options. More experienced users may fine-tune the algorithm, or change 42the detected track starts and ends, but generally that will not be 43necessary. Track-times are saved in an editable (plaintext) .tracks file, 44that will be used during the signal processing to produce one processed 45.wav file for each individual track. 46 47To record and play .wav files, modified versions of brec(1) and bplay(1) 48by David Monro are used. These programs provide buffered recording and 49playback, so all will go well even on a highly loaded system. Both 50programs have been supplied with the standard GramoFile user interface. 51Brec also got a `graphical' peak level meter, and bplay a running time 52display. 53 54 55INSTALLATION 56 57The file gramofile-1.6.tar.gz, available at 58 59 http://panic.et.tudelft.nl/~costar/gramofile/ 60 61contains the complete C source code of the GramoFile program. To unzip it, 62type 63 64 tar xzvf gramofile-1.6.tar.gz 65 66or, alternatively, 67 68 gunzip gramofile-1.6.tar.gz 69 tar xvf gramofile-1.6.tar 70 71Change the working directory to the newly created directory gramofile-1.6 72and issue the command 73 74 make 75 76to start the compilation process. 77 78 79Note for all 64-bit systems: when your `long'-type vars are 64 bit, .wav 80headers are not read/written correctly (=bug). If you replace every `long' 81with an `int' (or other 32-bit type), everything should be fine. 82 83Note for non-Linux systems (like IRIX): check the Makefile first, you 84probably have to uncomment some lines. Also, you probably won't have sound 85recording/playing capabilities. If you experience portability problems, 86please fix them and send me a nice patch ;-) 87 88Note for Solaris: there seem to be problems with the scandir() function 89not being present. It might be in the "SunOS/BSD Compatibility Library" 90(don't ask me...) 91Update: there is a scandir replacement in sun_scandir.c. To use it, add it 92to SRCS in the Makefile; also add a line 93 int alphasort(struct dirent **d1, struct dirent **d2); 94in the beginning of dirfilemenu.c. 95 96 97Note that the Makefile is written especially for use with GNU `make' 98(sometimes called `gmake'). That `make' implementation regards #included 99files as targets, enabling us to create and include dependency information 100in the same run as compiling the program. That's also the reason why those 101"file not found" messages appear: these files will be made and included 102automatically. More information on the GNU programs may be acquired by 103pointing your browser to http://www.gnu.org. If you don't have the GNU 104version of `make', you can simply comment the `include' line out; it is 105primarily useful during development activities. 106 107To run the GramoFile program, issue the command 108 109 gramofile 110 111 112USAGE NOTES 113 114General: 115 - The GramoFile program uses customized versions of `bplay' and `brec', 116 named `bplay_gramo' and `brec_gramo'. These programs are started 117 from within the `gramofile' program with just that names (no 118 directories). That means that they should be located in a directory 119 that is in your search path ($PATH), e.g. /usr/local/bin. But if 120 you don't want (or are not allowed) to put them there, add `.' 121 (current directory) to your search path, set your working directory to 122 the GramoFile directory and start the program with just `gramofile' 123 (the './' as in `./gramofile' should not be necessary). Note: this 124 is a known bug (if you like, send me a nice patch ;-). 125 - Information on CD burning issues may be found on: 126 http://www.fokus.gmd.de/nthp/employees/schilling/cdb.html 127 128Record an audio file: 129 - Use the `Mixer' button in the file selection screen to start 130 xmixer(1). Make sure the appropriate input (and no other) is selected 131 for recording. SoundBlaster(TM) owners: note that treble and bass 132 settings affect recording! I found SB16PnP works better with both 133 sliders at 50%, Richard Robinson reports his SB64Gold requires treble 134 65%, bass 45%. 135 - If you choose `Cancel' during the "Press Enter to start recording" box, 136 the selected audio file has already been created/truncated, and will 137 have zero length. So if you were overwriting a file, it was already 138 deleted before this dialog box appeared. 139 - The length as reported in the .wav header of the recorded file is not 140 correct. This is because brec doesn't update the header if the 141 recording was stopped prematurely (by pressing Enter). If you have 142 problems with this, simply process the sound file with the `Copy Only' 143 filter; the output file has the correct length in the .wav header. 144 Alternatively, you can make some additions to the bplay/brec source 145 code... 146 - To get the best out of track location, you shouldn't record too much 147 silence before the first & after the last track. 3-5 seconds silence 148 will probably get the best results. Also, I don't recommend recording 149 two sides of a record in a single (long) sound file; make two files 150 instead. 151 - If you want to view the input signal level without recording to a 152 sound file, try recording to /dev/null ;-) 153 154Copy audio from an audio-CD to a file: 155 - This option is not yet implemented. There are some plans to program a 156 uniform user interface to the cdda2wav(1) program here. You have to 157 use the bare program for this moment. More info: 158 ftp://ftp.gwdg.de/pub/linux/misc/cdda2wav 159 Alternatively, you can try the cdparanoia(1) program: 160 http://www.mit.edu/afs/sipb/user/xiphmont/cdparanoia/ 161 162Track location: 163 - Track location information is saved in a plaintext file with the same 164 name as the audio file but appended with ".tracks", as in 165 "firaru_side1.wav.tracks". You may view/use/edit this file as you 166 please. 167 - The ".tracks" file will be written in the same directory as the sound 168 file. If that directory is not writable, create a symlink to the 169 sound file from a directory like "/tmp/gramofile", and use that `new' 170 sound file instead. 171 - For more information on the algorithms used, and the procedure you 172 should follow to get optimal track location, see the Tracksplit2.txt 173 file. 174 - If you want to view the (optionally generated) .med or .sor files with 175 gnuplot, you may use a gnuplot-command like: 176 plot '/dir/filename.wav.med' using 2 smooth unique 177 or to view only a certain interval: 178 plot [1000:2000] '/dir/filename.wav.med' using 2 smooth unique 179 180Process the audio signal: 181 - If you choose to split tracks, numbered files will be created with the 182 `output filename' as base. If the `output filename' is entered as 183 "/tmp/test.wav", files like "/tmp/test01.wav", "/tmp/test02.wav", etc. 184 will be created. You will be warned if a file "/tmp/test.wav" exists, 185 although it will not be overwritten, but the 01, 02, etc. files will 186 be overwritten without your consent. Be warned! (This is also a bug.) 187 - You can also pipe the output data directly to some command that accepts 188 .wav-format input via stdin, when using a "filename" like 189 `|progname args outfile.ext'. Popular example: `|bladeenc -quiet STDIN 190 processed.mp3'. If track splitting is done, there _must_ be something 191 like a filename at the end of the line; e.g. the `.mp3' will be 192 replaced by `01.wav', `02.wav' etc. (Always `.wav', this is a bug.) 193 A new command is executed for each track. Note: 1) if the name can't 194 be the last item on the line, write a shell-script wrapper; 2) the 195 output file must be read once and in-order, which some programs (like 196 LAME!) can't do. Easily fixed with a script that first saves the data 197 to a .wav tempfile, then performs the wanted action, and finally removes 198 the tempfile. 199 - For more information on some of the implemented filtering algorithms, 200 and the implementation of new filters, see the Signproc.txt file. 201 - Known problem: the algorithm for the Conditional Median Filter II is not 202 optimal. With certain musical instruments and tones, the sound might 203 get distorted by an annoying `shot noise'. This is because those 204 instruments produce sawtooth-like sound waves, containing lots of high 205 frequencies. The `normal' highpass filter used by the CMF II detects 206 these high frequencies as ticks. You can solve this problem in two 207 ways. First, you may try to increase the tick detection threshold 208 (second threshold) to for example 7000 or higher. Second, you can try 209 to use an alternative highpass filter, by #defineing either FOURTH_ORDER 210 or SIXTH_ORDER in signpr_cmf2.c. These highpasses enhance very high 211 frequencies, so real (short) ticks are detected better, even when using 212 higher thresholds. 213 - Hint: if you are doing mono 78's, it might be profitable to use a 214 convert-to-mono filter first. You'll still get a stereo output file, 215 but with both channels identical. Use sox(1) or the like to convert it 216 to a real mono file. 217 218Write an audio CD: 219 - This option is not yet implemented. There are some plans to program a 220 uniform user interface to the cdrecord(1) program here. You have to 221 use the bare program for this moment. Try something like 222 223 cdrecord -v speed=2 dev=0,2,0 -audio -pad track01.wav track02.wav ... 224 225 Actual information on cdrecord may be found on: 226 http://www.fokus.gmd.de/research/cc/glone/employees/ 227 joerg.schilling/private/cdrecord.html 228 229 If you like a graphical front-end to write CD's, try the xcdroast 230 program: 231 http://www.fh-muenchen.de/rz/xcdroast 232 (Note: you may have to use the wav2cdr utility.) 233 234Play an audio file: 235 - Make sure the PCM and Master volumes are set high enough, and your 236 speakers are plugged in correctly and turned on ;-) 237 - I find the `Track' field to be extremely useful. If I've had located 238 tracks, I use one xterm with GramoFile, and another one with a editor 239 with the .tracks file. If I don't agree with the automatic detection, 240 I change the .tracks file, save it, and listen to the new beginning 241 and end in GramoFile. Note that the .tracks file is reread every time 242 you press B, E, F, A or Enter. 243 - To notice differences between filtered/non-filtered sound files, you've 244 got to have speakers that are fit for that purpose. I've found that big 245 speakers are quite `slow' and have a natural ability to reduce tick 246 volume, because they can't keep up with the speed. To be able to hear 247 the ticks as they are, little speakers are most useful, but small, 248 "low-quality" headphones (as used with cheap portable audio) are even 249 better. 250 251BUGS 252 253Plenty. Like max string lengths, un-free-d memory, bad error-handling. But 254if you don't do too extraordinary things, you shouldn't notice anything. 255The source code is definitely not portable (well, IRIX runs fine...). 256There is no manpage. There are no commandline options - so why bother 257about a manpage? Only text mode. Screensize is always 80x24. Only 258CD-quality .wav files are accepted (well, that was the purpose, wasn't 259it?). There are major language errors everywhere (please send me 260corrections). `make install' doesn't work. 261 262But I expect too have only very limited time to do something about all 263them bugs. You may report bugs at any time, direct them to 264J.A.Bezemer@ITS.TUDelft.NL. Completely worked out fixes are greatly 265appreciated ;-) 266 267 268AUTHORS 269 270GramoFile was developed by Anne Bezemer and Ton Le, students of the 271department of Information Technology and Systems (ITS), sub-department of 272Electrical Engineering (ET) of the Delft University of Technology (TU 273Delft). The first major part was written during the `Integraal Project 274Practicum' (IPP) in the spring of 1998. However, development has continued 275unofficially thereafter (so now we have track splitting operational :). 276Total development time is about 7 weeks full-time. 277 278The following persons have been very helpful and/or supportive during the 279`official' part of the project: A.P. Thijssen, E.A. Hendriks, A. Redert, 280J.A.H. Snelders, L. Meijs and R.J. de Gruijl. Other persons are mentioned 281in the ChangeLog file. 282 283Any questions, comments, suggestions and bugfixes may be mailed to 284J.A.Bezemer@ITS.TUDelft.NL (or try costar@panic.et.tudelft.nl or 285mcbzmr@dds.nl). But please understand that I'm a student with very limited 286time to do the more pleasant things in life. 287 288Have fun! 289 290 291-- 292All mentioned trademarks and registered trademarks are the property of their 293respective owners. 294