Linux Step By Steps
Ripping Vinyl and Burning CD's

 
or How to convert your old LP collection into CD's

From: "Alan Jackson" <ajackson@oplnk.net>


- Alan Jackson, alan@ajackson.org

How to rip tracks off a vinyl record, and burn CD's, mp3's, and ogg's.

There are a near-infinite number of ways to accomplish this.
I have found a path through the choices. Your mileage may vary...

I tried a number of the flashy, GUI driven tools. I had problems getting them to compile, or getting the rpm's to load, plus many
had a lot of flash but not much substance. So many of the tools I use are command line.
There are a number of steps to the process :

1. rip the tracks off the album onto your hard disk.
2. split the tracks up into separate files.
3. filter out noise (pops, skips, rumble, hiss, etc).
4. normalize the volume for the ripped tracks.
5. burn the image onto a CD.
6. convert files to a compressed format, mp3 or ogg.

Note that to have any hope of doing this, you need a fairly muscular
machine with a good soundcard. You also need a lot of free disk space.
Probably a 300 mHz chip minimum, and at least a Gig of free space.

I'm not going to talk about CD-RW hardware or setup, sound drivers,
sound cards, etc. I'll just assume you have met and conquered those
issues.

Refs :

gramofile : http://panic.et.tudelft.nl/~costar/gramofile/
normalize : http://freshmeat.net/projects/normalize/
studio : http://studio.sourceforge.net/
Ogg Vorbis : http://www.vorbis.com/
lame : http://www.sulaco.org/mp3/
cdrecord : http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html
GQmpeg : http://gqmpeg.sourceforge.net/mpeg-down.html (Nice frontend for mp123)
Freeamp : http://www.freeamp.org/
ecasound : http://www.wakkanet.fi/~kaiv/ecasound/welcome.html
baudline : http://www.baudline.com/
glame : http://glame.sourceforge.net/index.var
General : http://www.linuxsound.at
gtoaster : ??

------------------
Things I tried but had problems (maybe you'll have better luck) :

grip : http://www.nostatic.org/grip/ (Okay, but command line was simpler...)
kwave : http://kwave.sourceforge.net (requires KDE 1.2, I have 2.2)
snd : http://www-ccrma.stanford.edu/software/snd/ (segfaulted)
qtecasound : http://www.wakkanet.fi/~kaiv/qtecasound/download.html (g++ bug foiled me)


I think that if I got the qtecasound front end working I would
really like using that tool, but Redhat gave me a broken g++
compiler so I haven't got it running yet.

glame and ecasound are both powerful audio filtering tools which
you may want to play with. For garden variety ripping and burning
they are not necessary, but they can be fun to play with.

For playing mp3's and vorbis files I'm using mp123 and the GUI
front end GQmpeg. ovplayer is another that works well with Ogg Vorbis
files, as does freeamp. Xmms seems to be flakey for me, YMMV.

The main ripper I like (for LP's, not for other inputs) is a nice
program called gramofile that has some very powerful filtering
built in.

I like a little tool called normalize for normalizing the volume level.

SoundStudio is nice for fine tuning start and stop times for tracks,
and visually examining the wav files.

-----------------------------------------------------------
Step 1 : Rip

Don't forget!
- Set input volume to max with mixer
(use xmixer or kmix)
I run my phonograph into my old amplifier to take advantage of the
preamp, and take my output from the auxiliary tape output jacks. This
I plug into my sound card, into the stereo input jack (not microphone).

You may wish to record dead air first (or maybe ignorance is bliss!) to see
what sort of inherent noises your system is generating. I was a little shocked
when I did this. PC's are great little RF generators, and wires strung between
phonographs, amps, and sound cards are great antennas. Baudline is really
great for this. Fire it up, and open the display->average window. Then go
to input->devices and set up to read your stereo input. Then hit the red
button to record. Watch the noise peaks appear and build. I have an ugly one
around 8000-9000 hz.

run gramofile

Think about filenames and directory structure. I have a large, mostly
empty filesystem called /archive, so I set up directories like :

/archive/gramophone/Pink_Floyd:Ummagumma/

I record the raw data into files like side_1.wav, side_2.wav, etc.
Then I split those into files called side_1_01.wav, side_1_02.wav, for
each track.

- record
- name outputs side_1.wav, etc
- make certain that it didn't clip
- try a bit of first song to test level & then redo...
you want to get close to clipping without actually getting
there to maximize the dynamic range.
- Make a liner file with names & times in it while you're
recording.
- If clipping is a problem, adjust input volume with mixer.

Note that you really shouldn't do much while ripping, no heavy cpu or disk
activity. I try to read my mail and do some coding or word processing.
Balance your checkbook!

Step 2 and 3 : Process

continue with gramofile

- process
- Note for each song how it begins. Fades are hard to
pick. If the beginning is loud and the end fades, then
edit the track file to match the times on the album.
- may need to shorten the gap allowed. 1 block = .1 sec.
- may need to use studio to pick start and end times.
Studio is a little buggy, or maybe eccentric is a better
term. But it does allow you to graphically home in on where
a track begins and ends. For some albums this may be necessary,
especially where there are long fade-in and fade-out segments,
or where the track contains silent patches.
Baudline could also be used for this.
- I take the defaults for filtering and track detection.
- If you want you can view the median amplitude values in
a graph with gnuplot :
gnuplot
> plot 'side_1.wav.med' using 2 smooth unique
> quit
- play
- play each song to do final QC. Especially listen for
begin and end that they didn't get chopped off too soon.
- Sometimes the pop filter will cause signal distortion. If
you hear this, read what the docs that come with gramofile
have to say. You can shorten the median filter used, and this
will usually fix the distortion problem, at the expense of
allowing some pops through.

- filter
If you have special problems, some extra filtering may be necessary.
One album had an annoying 9000 hz hum in it, along with some
harmonics, so I filtered them out. Identify them with baudline,
you'll be able to see them on the display and measure the center
frequency and width. Use the 'average' display. Select all the data
and paste it into the average window and you'll get the average
spectrum, which will highlight hum quite nicely.
To get rid of it, I used ecasound. Here's an example :
ecasound -i:side_2_07.wav -efr:9020,150 -efr:18040,100 -o:side_2_07f.wav
This takes the input file and filters it at 9020 hz and 18040 hz.
You can't control the depth of the filter, but if it isn't severe
enough, just do it twice.
I wish I had a hilbert transform and some deconvolution filters, but
I guess I'll have to code those up... 8-)

Step 4 : Normalize

This step increases the volume to a good level. Do this or your CD's
may be very faint.
Note that it will update the input file, so if you want a before &
after comparison, make a copy of the input first. I like to
normalise a whole album side, or maybe even a whole album with one
value (the -b option).

- normalize
- first take a look at what the rms looks like
normalize -n *wav
- if reasonable, apply it
normalize -b *wav

Step 5 : Burning a CD

As root :

- Test it with :
cdrecord -v -dummy -pad -audio side_*.wav

- Burn it with
cdrecord -v -pad -audio side_*.wav

(note : had to edit /etc/cdrecord.conf to get it
to work - watch out for tab vs blank!)

Step 6 : Create compressed mp3 or Ogg Vorbis files

-----------------
- creating mp3 files
for i in *wav
{
lame -p -h -o $i `echo "$i" | sed 's/wav$/mp3/'`
}

- label mp3 files in GQmpeg with title, artist, album, year, etc
- bladeenc could be used instead of lame.

-----------------
- creating Ogg Vorbis files

oggenc --artist "Don McLean" --album "Don McLean" -t "Dreidel" side_1_1.wav -t "Bronco Bill's Lament" side_1_02.wav

Here's a little perl script to automate the process...

#!/usr/bin/perl -w

# input file like :
# --artist Don_Sanders
#
# --album Extended_Play_1973
# extended_play_01.wav Bruised_Fruit
# extended_play_02.wav Performance
# extended_play_03.wav Heavy_Word_User
# extended_play_04.wav One_Way_Jesus

use strict;

my %params;
my $command;

while (<>) {
next if (/^#/ || /^\s*$/); # skip blanks and comments
chomp;
if (/^--/) {
my ($tag, $value) = split(/\s+/,$_);
$params{$tag} = $value;
$command = '';
foreach (keys %params) {
$command .= " $_ $params{$_} ";
}
}
else {
my ($file, $track) = split(/\s+/);
print "$command -t $track $file\n";
`oggenc $command -t $track $file`;
}
}

Step 7. Burning a CD of mp3 or Ogg Vorbis files :

As root :

- Test it with :
cdrecord -v -dummy -pad -data side_*.mp3

- Burn it with
cdrecord -v -pad -data side_*.mp3

I'd suggest creating a liner file with the liner notes in it and adding
that too.