Professional CD Crafting with CDRDAO

All digital music listeners are equal. Acquisition is painless. Taste is irrelevant. It is pointless to boast about your iTunes collection, or the quality of your playlists on a streaming service. Music became data, one more set of 1’s and 0’s lurking in your hard drive, invisible to see and impossible to touch. Nothing is less cool than data. ~ David Sax

Physical media is back. vinyl and cassette sales are through the roof, and why shouldn’t they be? Digital music services have deprived us of that tactile feel of dropping a needle onto a well-worn album, and the intimate experience of pulling a record from its sleeve.
But today I’m focusing on the least flashy member of the physical media family: CDs.

Why CDs?

Everyone loves CDs. Seriously, even though it’s been a decade since anyone’s used a CD player, popping open a jewel case brings warm nostalgic memories to the forefront of our minds. But besides the nostalgia factor, why bother with CDs?

  • First off, CDs are highly customizable. Don’t like the ending of a song? Wish the crossfade was smoother between a few tracks on a playlist? Spend half an hour with editing software such as Audacity, and you can turn your digital playlists into mixtapes that rival albums and surpass playlists in musicality and momentum.
  • CD players are cheap, and most modern vehicles still have them. Unlike a phone, your favorite mixtape won’t run out of battery!
  • If you have an artistic bent, you can make CD art with nothing more than a few sharpie markers, like this!
image

Note: not my art, belongs to reddit user mddecker

The Problem

If you’ve ever tried to burn your own CDs using Windows Media Player or similar software, you know the results are much less than ideal. Because WMP burns the entire tracklist track-by-track, the CD player needs a half-second gap between each track. While an eloquent solution to be sure, this understandably kills an album’s flow, it’s momentum.

So why do retail CDs not have this issue? Well, instead of burning track by track, retail CDs are burned in DAO, or Disk-At-Once mode. Doing so encodes the track boundaries in the CD’s metadata, which in turn tells the CD player exactly where each track starts and ends. No gaps! Burning discs in DAO mode gives other benefits as well. Want track names that are visible on the CD Player? Want secret tracks akin to runout grooves on old records? All these are possible with DAO burning.

DAO burning software was once exorbitantly expensive and hard to track down. But luckily, our friends in the open-source community have a solution: cdrdao.

Using CDRDAO

CDRDAO is a command-line only program. but don’t be scared! Dear reader, I’ve done just about everything I can to make using this powerful program as easy as possible! However, you’ll need a few things first.

  • a computer that has A DVD RW Drive and is running some distribution of Linux.
  • my code from github
  • music files to be burned to a CD: .wav, m4a, or mp3 files

Downloading needed programs

here, you need cdrdao and ffmpeg. both can be acquired from your friendly neighborhood package manager.

On Arch Linux:

sudo pacman -S cdrdao ffmpeg 

Converting files to .wav

Cdrdao only works with .wav files. If your tracks are pulled from iTunes, they might be .m4a, or possibly .mp3 files. ffmpeg makes converting them relatively easy, but I also wrote a script that makes this process even more simple! This script quickly converts all the files in a directory of a given extension to .wav files, which can work with cdrdao! Here’s how to use it:

  1. in convertToWav.sh, modify the FILES variable to reflect the file type you’re converting from. For example:
FILES=*.m4a # this will convert all .m4a files in the directory to .wav files

FILES=*.mp3 # this will convert all .mp3 files in the directory to .wav files

FILES=*.<extension type> 
# this will convert all .<extension type> files in the directory to .wav files
  1. Run the program specifying the source directory as follows below:
convertToWav.sh ../Music/Crime_of_the_Century 
#this will convert all audio files in ../Music/Crime_of_the_Century into .wav files

convertToWav.sh <path to source directory> 
#this will convert all audio files in <source directory> to .wav files

NOTE: Not all .wav files are created equal! Some don’t work with cdrdao due to encoding issues. to work around this, change the extension to .wav, and run the conversion program!

Song Number Shifting

When burning with CDRDAO, all your tracks need to be in the same directory. In order to preserve song order, each track is numbered like so: '01 In This State.wav' If you’re building a mixtape song-by-song, manually re-numbering tracks is no problem. But if you’re putting multiple songs from the same source on a disc, this gets tedious. enter songShift.sh.

Let’s use an example for this one. I have 3 directories: Album1, Album2, which contain songs I want to combine into one CD, and Mixtape, which will hold the final album .wav files in the correct order. Let’s say we want to put Album2 after Album1, and Album1 is 8 tracks long. Then we’ll run the program like this.

songShift.sh <path to Album2> 8 #shifting all track numbers by 8
cp <path to Album2>/*.wav <path to Mixtape> # copying all the shifted songs to the Mixtape dir.

Generating TOC

Cdrdao uses a TOC (or Table Of Contents) file as a template for the contents of the CD. This file contains the track listings, and is used to burn the CD with pretty track names. Full documentation for TOC files is found here. I wrote a script to take some of the tedium out of generating these TOC files. Simply run the program as follows!

genToc.sh <path to directory with .tracks>

Burning CD

The next step is simulating the CD burn, which allows you to catch any errors before actually burning the CD. Just run cdrdao simulate in the same directory as the TOC file and .wav files. If this doesn’t spit out any errors, you’re ready to burn! Run the following command to burn the CD!

cdrdao write --driver generic-mmc-raw --eject (toc file name) 

Future Improvements

  • I was really interested in doing all of this from the Linux command line, so there are no instructions for Windows. I know a Windows version of CDRDAO exists, so best of luck translating these instructions to Microsoft-ese, Windows users!
  • I also eventually want to modify the wav converter to work with files other than m4a.

Small Aside

A few people claim that CD sound quality is bad, 44.1 kHz music isn’t high-res enough, and that they can hear the difference between low and high bitrate music. While this indeed used to be the case (with extremely low bitrate music), it is no longer true. Don’t believe me? Check out this article!