Saving Your Old Vinyl

Saving Your Old Vinyl

So, finally, how do I put all this good information to use? I'll illustrate some of the finer points from this chapter in an example. In this example, we'll be saving our old vinyl records from the dust pile.

The great thing about Linux is the abundance of high-quality , free applications. I feel that some of the best applications for Linux are the ones that have been around for years . Like those applications, some of the best albums in my collection are the old vinyl records. My old comedy albums, for example, bring back childhood memories and are still hilarious to listen to. I've always wanted them on CD, but I didn't want to buy them all over again. So I did the next best thing: I converted them into CDs myself . The best part of doing this is listening to all those old comedy bits again. Of course, it's also hard to keep track of where you are in the recording process when you're on the floor all teared up and laughing.

This section will walk you through all of the steps of transferring your old record collection to CDs. Not only will this save you money, it will allow you to preserve records that may not even be available on CD because the copyright owner decides it's not "profitable" to rerelease the old recordings and that the masters should instead decay in a musty vault somewhere.

Preparation

As with most things, preparation is the key to success. Before you begin your recording process, make a plan of what you want to do. It may seem simple, but once you're into it, you don't want to start changing things around. Figure out how you want to organize your collection. Some of the questions you should ask yourself are:

Do I want one record per CD?

Do I want a CD full of MP3 files or playable audio for a compact disc player?

Do I want fancy CD labels and case inserts ?

Do I want to keep a copy of each track on my hard drive?

Do I have time to do this today?

Here was my plan for saving each of my Bill Cosby albums:

1.        I want one CD per record.

2.        I want fancy labels and jewel case inserts.

3.        I want to end up with a playable audio CD and MP3 files for my computer.

4.        I will make a project directory called comedy_albums to hold all the albums.

5.        In the comedy_albums directory I will make a project directory for each album.

6.        Each file will be named according to the track number (trackxx, where xx is 01, 02, 03, and so on).

7.        Each file will be stored in CDR format at 44.1 khz (suitable for audio CD production).

8.        I will convert from CDR format to MP3 at 128kb.

9.        After burning all tracks in an album directory, I will erase all the CDR files, leaving the MP3 files.

10.    Finally, I will create a playlist for each album and store it in each album directory.

Cleaning

A common problem with CDs and records is that they need to be cleaned periodically. I highly advise you to obtain a good cleaning solution and cloth suited for records. Because you're not remastering the audio from the original tape recordings, your recordings from the album will reproduce, in digital clarity, every pop, click, and hiss a record has to offer. A dirty record is not a good way to begin a recording session.

System (Space, Tools, etc.)

If you've ever downloaded an MP3 file, you know they can be fairly large. The longer the song and the higher the quality of the MP3 file, the larger it will be. For example, a three-minute song with a bit rate of 256 will produce somewhere in the neighborhood of 5 to 6 megabytes, depending on the software used to encode it. This same song at 44.1 khz in WAV format might be 50 megabytes. A typical CD-R will hold about 70 minutes of audio (a two-second gap between each track should be taken into account). It is important that you have enough space available on your hard disk to hold an entire album of audio. As my former boss used to say, "Disk is cheap." Do yourself a favor and buy another hard disk if you need more space. Trying to work with a limited amount of disk space will certainly make the project a lot more frustrating than it has to be.

Audio System

Record players require an amplifier. In order to record onto your PC, you must first boost the signal from the record player, using an amplifier. Most of us don't have professional recording equipment at our disposal. If you have an ordinary home amplifier with phono RCA jacks and TAPE IN and TAPE OUT RCA jacks on the back, you have all the audio gear you'll need.

There are several audio system configurations you can choose from, depending on your needs. My needs are probably different from most because I also create music and videos with my Linux system. I have a mixing console, multiple amplifiers , monitor speakers, and several audio devices in my configuration. Your configuration may simply include your record player, amplifier, and computer with attached speakers . Chapter 20 , Music Production, contains a diagram of the more complex audio configuration.

Figure 19-6 is a picture of how you might configure your audio system for recording from a record player to your computer. In this picture you will notice a special cable connecting an RCA jack to mini-headphones. These cables are inexpensive and can be found at most consumer electronics stores. In order to record from the record player, you must connect the record player to the amplifier, which provides the pre amplification for the record player. Then, treating the computer as a tape recorder, you attach your computer soundcard's LINE-IN to the amplifier's TAPE-RECORD, or TAPE-OUT, RCA jacks. In this configuration, no other connections are needed, since sound will be played on your computer speakers. Make sure you turn off the amplifier's speaker, if possible.

Figure 19-6. Audio system configuration 1.

If you cannot do this, then use the configuration shown in Figure 19-7 , a slightly more complex configuration that includes speakers attached to your amplifier. This allows you to play your recordings and any other music on your system through your home audio system. In this picture, the soundcard's LINE-OUT jack is connected to the amplifier's TAPE-PLAY or TAPE-IN RCA jacks. This provides an excellent way to hear those MP3 files on your hard disk through your home stereo, which is probably a lot better than your computer speakers.

Figure 19-7. Audio system configuration 2.

Recording

Now that you have your audio hardware configured, you are ready to begin the recording process. Following your plan is a good starting point. For me, I decided to record each track of the record to its own file and then burn all the files onto a single CD. Recording is probably the easiest part of the process, since it only involves recording each track of the record to a file. The software you choose to do this will determine exactly how easy this task will be.

Software

The software used for the recording can range from GUI-based WAV recorders to text-based sound utilities that serve many functions. We discussed some of these earlier, and I chose to use SOX to record and play back my sound files. Visual editing of WAV files with audacity or similar tools might be required for some projects, but recording tracks from a record requires nothing more than simply recording the tracks to a file. Because of this, I also chose to record my tracks into CDR format. CDR is the format for an audio file that can be written directly to a CD-ROM disk without conversion. It is basically a CD-quality RAW file (again, CD quality is 44.1 kHz, 16 bits, 2 channels, little-endian).

My distribution of SOX includes a script that simplifies the recording and playing of audio files. Even so, I still found it valuable to make my own script to simplify the recording process down to a single, simple command line:

  $ cdr track_name  

cdr is a script in my personal bin directory. Here is the source to cdr:

 rec -s w -c 2 -r 44100 .cdr 

This is the same command line I showed when we first discussed SOX. rec --help will give you all of the available recording options. I chose to record to a filename that is the cdr parameter with an added file extension.

The trickiest part of the recording process is to make sure to ready the command line for each track on the record with a new filename and to press Enter in time before the track starts. To record a track off my record, I change to my project directory for the album and ready my command line as follows :

 $ cdr track01 

Then I set the needle on the record, wait for what I feel is an appropriate time, and then press Return to begin the recording process. If I'm lucky, the recording starts before the record begins playing. Eventually, all the tracks for both sides of the record will be recorded. Now it's time to process the audio files in order to get them ready to be burned onto a CD-R.

If your audio equipment and computer are set up to work together properly, you should be able to listen to your record player through your soundcard and computer speakers. If not, check your connections with the diagrams given earlier. When playing back your track, use the play utility that comes with SOX.

If you end up with a huge file of silence after you finish recording a track, make sure the recording source is set correctly in your mixer. Next, make sure the input gain is set to the proper value. I mentioned how to do this earlier in the chapter. The volume slider for LINE IN will not affect the recording volume; rather, it determines how much of the LINE IN signal gets passed through to the output of the mixer.

Cleaning Up

The least fun, but most necessary part of this project is that of cleaning up all those audio files you just recorded. They are probably not perfect, but they can be made better. SOX is a great tool. Once you understand how it works, you will be working like a pro, but without the expenses.

Removing Clicks, Pops, and Hiss

Records are not perfect. They pop, click, and have a nasty hiss to them. But that's what makes this project so fun. The challenge is not to remove the pops and clicks, but to reduce them so they're not so annoying. I actually prefer to hear a few clicks now and then to remind me of just how old some of my records really are. Listening to a remastered comedy album, for instance, just isn't the same without hearing the needle of the record player grind over old scratches from many years of constant play.

SOX provides everything you need to reduce hiss, pops, and clicks in your audio files. As is my style, I use a shell script to simplify the processing of the audio files, since they can all be processed with the same SOX command line options. My script, clean, takes a filename as the only argument. It writes the SOX output to a temporary file, deletes the original, and then renames the new file back to the original name . Here is the source to clean:

 #------------ 
 # clean 
 ------------ 
 mv .cdr .orig.cdr 
 sox .orig.cdr .cdr lowp 4000 deemph 
 rm .orig.cdr 

Now simply execute the clean command for each file in the project directory, as follows:

 $ clean track01 
 $ clean track02 
 : 
 : 

Or even:

 $ for num $(seq -w 1 12); do clean "track$num"; done 

Your files are almost ready to be burned to a CD-R. There is, however, the problem with time before and after the recorded audio. If you're like me, you probably overcompensated for the start and end of the record track. This can lead to long delays before the audio actually begins playing. With a two-second delay between CD audio tracks, this silence at the beginning and end of a track can add up to annoyingly long pauses between tracks. What is needed is a way to trim the excess silence from the beginning and end of the audio files.

Trimming

You could use audacity to trim excess space from the beginning and end of file, but luckily there's a more obscure way. dd is a utility for copying a file while applying a particular format or conversion to the file. For example, dd can be used to convert between ASCII and EBCDIC, which is very useful if you routinely trade files with an EBCDIC-based mainframe. It also has the ability to skip blocks from the beginning of a file. This is the feature that will enable you to trim off the excess time from the beginning of the file.

Timing is everything. In this case, it's crucial. The first part of trimming the beginning of the file is knowing that a CDR audio file is formatted in 2352-byte blocks and that each block lasts 1/75 of a second (remember these numbers , from before?). Knowing this, it's easy to remove any number of blocks from the beginning of a file by telling dd to skip a given number of 2352-byte blocks. This is done with the following command line:

 $ dd bs=2352 if=track01.cdr of=track01.trim.cdr skip=300 

The following table explains the command line options in detail.

bs=2352

This sets the block size to 2352 bytes.

if=track01.cdr

This specifies the input file.

of=track01.trim.cdr

This specifies the output file.

skip=300

This specifies the number of 2352-byte blocks to skip from the beginning of the input file.

As is my usual style, I have written a small shell script to assist in the trimming process, called trimb :

 #--------- 
 # trimb 
 #--------- 
 dd bs=2352 if=.cdr of=.trim.cdr skip= 
 if [ "" = "save" ] 
 then 
 rm .cdr 
 mv .trim.cdr .cdr 
 else 
 play .trim.cdr 
 fi 

The idea behind this script is to allow for trial and error. Basically, it's a guessing game when it comes to determining the number of blocks to trim from the front of the file. For this reason, the script plays the file after trimming so you can hear if the number of blocks entered was the right number of blocks to skip. If not, hit Control-C and try a larger number:

 $ trimb track01 100 
 (control-C) 
 
 $ trimb track01 200 
 (control-C) 
 
 $ trimb track01 255 
 (control-C) 

Once you've found a number that works, simply reissue the command and add the word save as an additional parameter and your trimming will be made permanent:

 $ trimb track01 255 save 

We now move on to trimming the end of the file. The best way, of course, is not to have to trim the file at all. This means listening to each track as it is being recorded and hitting Control-C to end recording at the end of the record track. Otherwise, this part of the process is going to seem somewhat odd. Simply put, the audio will be reversed, trimming will be applied to the silent audio at the front of the reversed file, and then the audio will be rereversed to its final state. For this, we'll use a slightly modified version of the trimb script, which I call trime :

 #---------- 
 # trime 
 #---------- 
 sox .cdr .reversed.cdr reverse 
 dd bs=2352 if=.reversed.cdr of=.trim.cdr skip= 
 rm .reversed.cdr 
 if [ "" = "save" ] 
 then 
 rm .cdr 
 sox .trim.cdr .cdr reverse 
 else 
 play .trim.cdr 
 fi 

The process is the same as trimming the beginning of a file, except the audio you hear will be reversed. Just listen for the silence and keep increasing the number of blocks to skip until you're satisfied with the amount of silence at the beginning (which is really the end of the audio):

 $ trime track01 50 
 (control-C) 
 
 $ trime track01 80 
 (control-C) 
 
 $ trime track01 100 
 (control-C) 

When you've found the right number, add the save parameter, and your file will be trimmed and reversed back to normal:

 $ trime track01 100 save 

Once you've trimmed all of your audio files, you're ready for the final step in the project, preserving those tracks for future listening.

Preserving Your Work

There are a couple of methods which you might choose to save your newly created CDR tracks. The most obvious is to simply keep the CD-R or WAV files on your hard disk and play them back when desired. But this requires a lot of disk space and is not practical if you have a large library like I do. Your choices are basically limited to your available resources and system hardware configuration. If you have a CD-R or CD-RW, you can save your audio files to an audio CD-R and be able to listen to your new audio CDs in your car or on your home stereo ( assuming you have a CD player in your car or home). If not, your other choice would be to convert the audio files into a format that conserves disk space while maintaining audio quality. A good format for this is the MP3 audio file format; Ogg would serve equally well.

Audio CD Creation

Linux offers a variety of tools for audio CD creation. Many of the GUI tools are simply front ends to command line programs. Some include libraries that implement the same features as the command line program, which are made from the same library. I, being a command line junkie, chose to use the cdrecord program for its relative simplicity and its nice set of features (most of which I never use).

In case you haven't guessed, simplicity is my goal. In fact, it's a lifestyle. If I can take something complex and simplify it, I will. With this, I offer up my burnaudio script:

 cdrecord -v speed=2 dev=0,0 -audio *.cdr 

While it may look simple, it hides lots of complexity. Actually, I just don't like typing the same thing over and over again.

The options for cdrecord are numerous . Luckily, the ones we need for audio CD creation are few and are detailed in the following table.

-v

Be verbose. Tell us what's going on during the recording process.

speed=2

Set the recording speed to 2x. Set this to the speed of your CD-R burner . Check the man page for cdrecord for acceptable values.

dev=0,0

This is a rather complex option. Basically, it tells cdrecord where to find your CD burner in your SCSI subsystem. It means SCSI Controller 0, Bus 0, and, implicitly, Device 0 and LUN 0. Yours may be different, something like 0,0,6,0. Use cdrecord scanbus to find the values that are right for you.

-audio

This tells cdrecord that you are burning an audio CD-R as opposed to a CD-R with data on it.

$1*.cdr

This is a wildcard filename passed to my script. If you named all of your tracks as suggested, track01.cdr, track02.cdr, and so on, you should simply be able to pass the word track as a parameter to burnaudio.

So to burn a CD-R with all of the tracks just recorded, simply execute the burnaudio command as shown:

 $ burnaudio track 

If all goes well, you will have a perfect CD-R of your favorite old record album. If all does not go well, you will need to consult the documentation for your specific distribution of Linux in order to resolve any problems you might have, such as enabling the ability to use an IDE based CD-R drive or how to configure user access to your CD-R drive so you don't have to be root every time you wish to burn a CD-R.

MP3 File Creation

Lastly, even though you might have a CD-R with the audio tracks you just created on it, you might want to have instant access to your audio files from your computer. As mentioned before, storing the CDR or WAV files on your hard disk as a long- term solution can be very costly in terms of disk space, and eventually money, for when you run out of space and need to purchase a second or third hard disk. Compressing the audio files is the best alternative to storing them uncompressed. To do this, it is recommended that the files be converted to the MP3 format, which can save a significant amount of disk space while maintaining a reasonable level of quality in your recordings.

As usual with Linux, there are several programs to choose from to convert your files into MP3 format. I prefer bladeenc for its speed and quality. The following command line will encode an audio file:

  $ bladeenc track01.wav -128  

The command line options are amazingly simple and are explained in this table.

track01.wav

The input file to be converted.

-128

The bit rate determines the quality the resulting MP3 file will have. Generally, the higher the bit rate, the higher the quality and the larger the resulting MP3 file will be. Considering the source for your audio, a bit rate of 128 should be sufficient for your needs and will keep the file at a reasonable size. You could probably get away with 96 kbps if you're a real disk space hoarder.

You might have noticed that the source file for bladeenc was a WAV file and not a CDR file. For this reason, I have one last shell script to assist in the process of converting a CDR file to an MP3 file:

  #----------  
  # cdr2mp3  
  #----------  
  sox .cdr .wav  
  bladeenc .wav -  
 rm -f .wav 
 rm -i .cdr 

The script converts the CDR file to a WAV file and then encodes the WAV file into an MP3 file at the provided bit rate. Finally it removes the unwanted WAV file and prompts for the removal of the CDR file. Execute the cdr2mp3 for each file, as follows:

  $ for num $(seq -w 1 12); do cdr2mp3 "track$num" 128; done  

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net