Iain Lamb · classical tags

March 3, 2009 ‒ 8:41 pm

These days, I hardly ever listen to music via compact disc. I listen to music on DVD or Super Audio CD or to digital music files ripped from compact discs, either on my squeezebox or iPod. Many classical albums still aren’t available from digital music stores (or aren’t available in sufficiently high quality), so I still buy a fair amount of compact discs, which I need to rip immediately.

And that’s the rub. The present set of tools and processes involved in ripping classical music are still surprisingly awkward. I wanted to share my approach, in the hopes it might be helpful to somebody else out there.

First, a little more background. Once I go to the trouble of ripping a cd, I never, ever want to do it again. For this reason, I always rip compact discs to FLAC, which is a perfect archival format. It’s not only lossless, it’s open source, and it has a robust capacity for metadata and album artwork. Once a track is ripped to FLAC and appropriately tagged, it can act evermore as the source of truth for a piece of audio – an apt starting point for any further compression work to the lossy codec d’jour. I wonder how many folks ripped their whole collection to 128kbit/s CBR mp3 only to learn that they should have used VBR encoding with a higher bitrate and then, whoops, AAC is actually a better codec and now they need to start over because that high fidelity data is gone and, oh no, all their original CD’s were sold to a used music store, thrown out, or glued onto a memorable dancing outfit?

I wish I could just rip all my music to FLAC and be done forever more. Alas. While I can play my hefty collection of FLAC files on my stereo via my squeezebox, FLAC files just aren’t appropriate to store on my iPod at present. Apple doesn’t support the file format, and memory capacity on those gizmos is still too precious; it only makes sense to have aggressively compressed AAC files on these devices (AAC handily outperforms the quality versus compression efficiency of mp3).

With all these needs in mind, I’ve assembled a crack team of mostly free tools: Max, Tag, metaflac (I install from Mac Ports via $ sudo port install flac), a scanner (not essential), photoshop (not essential), iTunes, and a few home-cooked scripts – all of which just use metaflac under the hood. Sorry – my approach just describes how I get things done on my Macbook Air, so if you don’t use OS X, you’ll need to adjust these instructions to the needs of your platform.

Step 1: rip the CD to FLAC

I pop the CD into my optical drive, and launch Max, which grabs the album metadata from MusicBrainz. If the data isn’t good – it often isn’t – I check whatever iTunes came up with (it’s sometimes worse). If I prefer iTune’s metadata, I grab it via the “Get iTunes Metadata” script included in the distribution of Max (I have to open up the script in ScriptEditor and click the run button, with both Max and iTunes open with the cd in the drive).

Either way, the tags I end up are only a starting point. Off the shelf, classical music tags are typically malformed, insufficient, or erroneous. Instead of getting worked up about poor metadata at this point, I just go ahead and rip the tracks to FLAC. I appreciate the “full paranoia” error correction, turned on by default to verify an accurate read.

Step 2: edit the metadata of the FLAC files

First, I have a scrub Python script clean unwanted data from the files. I set any cover artwork in the file aside with

metaflac --export-picture-to

Then I run:

metaflac --remove --except-block-type=VORBIS_COMMENT

The scrub script also uses metaflac to scrub unwanted tags. This could be done with Tag too. I’m not saying these tags are bad, it’s just that they are often unneeded, incorrect or vestigial, and I can set them later if they are relevant. Sayonara:

  • ENCODER
  • ENCODING
  • SETTINGS
  • COMPILATION
  • ALBUMARTIST
  • DESCRIPTION
  • DISCNUMBER
  • DISCTOTAL

Next, I’m ready to start adding or editing the track tags. The first task: give each track a useful ALBUM tag. This should be a unique label which describes the work, usually in the form:

Composer: Work (Artist Year)

Note: The ALBUM tag does not necessarily correspond to the name of the CD. Why? Because once the music is in digital form, I don’t care what CD it originally came from. Stated another way, I’m not going to care which parts of which symphonies were optimized to the capacity of which compact discs. I’m just going to want to listen to Symphony No. 1, period. That means some of the same tracks on a CD can have different ALBUM tags, and tracks on two or more discs might have the same album tag.

Note how I said each set of tracks should share a unique ALBUM tag value. This will come in handy later. I like to put all works by a composer into one folder bearing the composer’s name, e.g. Mahler. If I end up with a different recording of Mahler’s first symphony, (such as Bernstein’s recording on Deutsche Grammophon), I’ll be able to distinguish one recording of same work from another, both on the filesystem and the player system. For example:

Mahler: Symphony No. 1 in D major “Titan” (Bernstein 1966)

Since the ALBUM tag describes the work, the track TITLE tag can now just describe the name of the piece. Often, I have to trim a bunch of cruft from the front of the title. To get all the title information correct, I usually have to find it online or look at the book that came with the CD and go through each track meticulously, adjusting spellings, capitalization, properly accented characters, and punctuation. If there are several pieces making up a movement, I number the pieces in the title with a decimal prefix:

1. Langsam. Schleppend. Wie ein Naturlaut

If there are ten or more pieces, I have to pad the label with a zero:

05. “Wie Felsenabgrund mir zu Füßen” – Pater Profundis

Finally, if there are multiple movements in the work, I add an additional roman numeral prefix:

V. 09. Mit Aufschwung, aber nicht eilen “O Schmerz!”

Next, I make sure all tracks have the correct COMPOSER and CONDUCTOR tags. I make sure the ENSEMBLE tag is set to the symphony or group who performed the piece. If there are solo or featured performers, I add PERFORMER tags describing each one. The DATE tag typically just describes the year of the recording. For extra credit, I might add a PUBLISHER tag. On occasion, I’ve added an ARRANGER tag (to recognize Malher’s arrangement of Schubert’s “Death and the Maiden,” for example).

I set the ARTIST tag to the name of main person featured on the recording. That would be Leonard Bernstein in this case, but it might be Anna-Sophie Mutter in another.

If a CD contains multiple works or a single work is spread across multiple discs, I need to adjust the TRACKNUMBER and TRACKTOTAL tags to reflect the track’s position in the overall work. I’ve written a Python retrack script to help me do this via metaflac, but this can be done in Tag too.

Finally, I need to store the cover artwork into each FLAC file. If I previously extracted the artwork or it is available on the web at a sufficiently good quality through an image search, I use that. Otherwise, I scan the cover art at 500 × 500 pixel resolution or greater, saving the result in photoshop “for Web & Devices” as a high quality JPEG. Next, I put the picture data into the track data via:

metaflac –import-picture-from

(Again, I have a Python script which automates all this, but you can do it from the command line)

Phew! At the end of all this, I have a new set of beautiful FLAC files for my archive collection, tagged like this:

ALBUM Mahler: Symphony No. 1 in D major “Titan” (Bernstein 1966)
TITLE I. 1. Langsam. Schleppend. Wie ein Naturlaut
ARTIST Leonard Bernstein
ENSEMBLE New York Philharmonic
COMPOSER Gustav Mahler
CONDUCTOR Leonard Bernstein
DATE 1966
TRACKNUMBER 1
TRACKTOTAL 16
GENRE Classical
PUBLISHER Sony Classical

As a final step, I apply my rename Python script move the tracks into the archival folder in my filesystem. Typically, in that folder, each track is named according to its metadata:

Composer/Album/FLAC/track number – track title

For good measure, I put a copy of the cover artwork into:

Composer/Album/cover.jpg

Since my squeezebox can play FLAC files, I’m now ready to play the classical tracks through my stereo at home. The “squeeze center” server software supports a special ALBUMARTIST tag. Anytime it’s found in a track, its corresponding value (the name of a person or group) shows up in server’s artist list as a means of browsing all tracks which share the value. This makes it possible browse your music via conductor, ensemble, composer, arranger, or performers.

(I have a Python script go through my FLAC collection, assemble a list of unique values culled from the artist, composer, conductor, arranger, and performer tags for each track, and add an ALBUMARTIST tag for each value in the list. This is the great thing about FLAC metadata: once it’s all in there, it’s easy to write custom applications to useful, custom things, making the music feel like it’s truly your own).

Step 3: generate AAC files for iTunes/iPod

I make a clear distinction between the kind of music I store in my archive versus the kind of music I keep on my iPhone; I keep all the music I own in my archive, stored at the highest possible quality, and keep it backed up. It’s my permanent collection. External hard drives are plenty big these days to pull this off.

By comparison, my iPhone has very limited capacity. Whatever music ends up on it tends to be elite selection from my overall archive, reflecting my capricious whimsy. To make as much room as possible for other media, each track needs to be compressed just to the point where my ears hopefully can’t detect the difference from its FLAC counterpart. That means I need to use a lossy codec like AAC. The collection of music on my iPhone is disposable; the master files are backed up in the archive, so it’s not the end of the world if my player is lost, damaged, or stolen.

Thus, I generate music files for my iPhone à la carte. I use Max to produce AAC files from the FLAC master files. It’s as easy as drag-dropping the masters into Max (or typing open -a max *.flac from the command line). I check the encoder (in preferences) to MPEG4 Audio (AAC), with Quality set to Maximum, Bitrate to 160, and “use VBR” checked.

I just open up the new AAC in iTunes and I am good to go! If I’m feeling energetic, I might press ⌘i to set the Album Artist field to whatever the ENSEMBLE tag said on the FLAC original.

All this work yields spectacular results on the iPhone. I’m able to browse by composer (Gustav Mahler), artist (Leonard Bernstein), or album (one album per symphony-year-opus). When I play a track, I see the artist, symphony, composer, orchestra, and song name (which includes information about the part, movement, or track order within a movement that the song belongs to). Good stuff!