CD Audio Instructions & Information

Using this stuff
Installation Notes
Usage Notes

Note:You don't need to use the scripts and programs here - other than sox - to make audio cd's on an SGI.

You can simply:

In fact, you may need to use the above procedure if you try and copy one of the newer multimedia audio cdroms (e.g., Offspring's "Americana") and the track2disk program below gets upset.

However, this procedure is very tedious - the interesting part is arranging the tracks the way you'd like them. Waiting for tracks to copy in in realtime is very boring and requires you to come back every few minutes to start another track.

I like the idea of using a spreadsheet and having the track times calculated, plus having the use of cut-and-paste to arrange the contents. Many artists have web pages with the track names, which are easy to paste into the spreadsheet if I don't want to type them. There is also a program to print out album track names and times if the album is listed in the cddb database.

The spreadsheet contents can easily be exported to one of the pc cd label making programs.

Lastly, our cd recorder (Philips 2600) needs to have audio data byte-swapped before writing. When going the "drag in the track, convert with sox to cdr, cdrecord -swab" route, I got thumps between the tracks. I don't like thumps. The short "track2disk" program uses the very nice SGI cdaudio utilities to pre-swab and de-emphasize (if needed) the tracks so they can go right out to cdrecord. I don't need sox and extra processing time (except for preview), and, for whatever reason, I don't get thumps between tracks.

Please note that I did this stuff a while ago, before the cddb stuff on the web had really taken off (www.cddb.com). The scripts should really take advantage of the huge cd database out there to automatically pick up the track names, rather than relying on the much smaller SGI cddb set on ftp.sgi.com.


Installation Notes:

Install the software with inst/swmgr from the web tardist file. To run the utilities, you'll need to have /usr/local/bin and /usr/freeware/bin in your path. Note that you'll also need the fw_cdrecord package (cdrecord) to actually write cd's.

Before running the software, you MUST (as root) edit the files (in /usr/local/bin)

copy_audio_tracks
preview_tracks
write_audio_cd

and change

$MUSICDIR

to a local disk directory where there is at least 800MB space. It is set by default to /disk2/music. You could of course just make /disk2/music a symbolic link to someplace where you have space. You may also need to change the entry:

dev=1,4,0

in write_audio_cd if your cd writer is not on scsi bus 1, unit 4, LUN 0.

NOTE: This software was tested on the Philips 2600 - your cd recorder may do things slightly differently. Most importantly, the cdrecord program used to write the cd's may need to have the audio data byte-swapped before sending out. If you write a cd, then play it back and get buzzy static, edit the file /usr/local/bin/write_audio_cd and add a "-swab" argument after the "-audio" argument.

If you are tempted to change the "-b" (byte swap) flag of the track2disk program used by copy_audio_tracks instead, I would advise against it. You'll have to watch for pre-emphasis on individual tracks and tell cdrecord about it them, and you'll have to change the preview_tracks script to not swab the data back for soundplayer to play it.


Making an Audio CD

Fill in a sample spreadsheet from the template

/usr/local/doc/MAKECD.XLS

with information on tracks you want on your new cd. The spreadsheet will tell you how much time you've used on the cd. Note that Wingz doesn't work, as it doesn't seem to have a FLOOR function. Excel via softwindows works well, plus you can use the other PC utilities mentioned. There are some other sample files in /usr/local/doc you can cut-n-paste from if you'd like. Of course, you can simply fill out the MAKECD.TXT version of the template by hand with any ascii editor, as long as you preserve the overall format and don't put a lot of extra crap where the entries should go.

If you want to save some time, you can use the printtracks program to print out the track names and times in tab-delimited format for easy import into a spreadsheet. It will use the "cddb" database to find artist, album title, and track name if available (see or download from ftp://ftp.sgi.com/sgi/cd-catalog if you don't have it). If the cd is not in the catalog, then a placeholder will go in the empty database fields and at least you'll have the track times. To use printtracks, insert the cd you want to copy tracks from and type:

printtracks > myalbum.txt

You can open this file under excel, then cut-and-paste the tracks you want into the MAKECD template.

Save the spreadsheet you made from the MAKECD template in "text" or tab-delimited text format. Then type in:

copy_audio_tracks your_spreadsheet.txt

copy_audio_tracks will prompt you for the cd to put in and copy in the track. Not that this happens in realtime - i.e., a 4 minute track takes 4 minutes to read. Do the laundry or read a book during this phase. Note: if copy_audio_tracks returns "Couldn't open CD-ROM drive" messages, it's possible you have either cdplayer or SoftWindows open. They will be grabbing control of the drive, so you'll need to close these applications and run copy_audio_tracks again.

When done, you can run

preview_tracks

and it will convert/play 20 seconds from the beginning of each song in the order they're going on the cd. You don't need to do this, but it's a good practice. The underlying programs don't check closely (yet) to see if you stuck in the right cds when copying in the data.

Next, stick a blank cd in the cd recorder, su to root, and run:

write_audio_cd

It will tell you if you have exceeded your limit on the disk, and offer you bail-out points (it's running "cdrecord"). The cd write happens at 2x speed, so it will take about 38 minutes (including fixating) for a full 74 minute audio cd.

Remove the "Track*" files in $MUSICDIR when you're done. They aren't automatically deleted because sometimes mistakes happen. If they do (you didn't preview the tracks and your daughter stuck in Barry Manilow instead of Smashing Pumpkins), you can re-run copy_audio_tracks. It will allow you to skip copying in the tracks you already have.


rickv@sgi.com