iTunes Library Management

I recently ripped a whole bunch of wav files using iTunes and made the mistake of importing them into the iTunes library of a second computer. iTunes did not recognize the songs and wasn’t able to index them, so I made the brilliantly stupid mistake of letting iTunes manage my library, thinking that the index might be refreshed, but what happened instead was iTunes moved all the songs into a sub-directory named, “Unknown Album” in a directory named, “Unknown Artist.” Now I can’t identify artists or albums, only song titles. This has to do with wavs not having this information embedded. I’ve still got the original library file on the first computer, so I can manually link to each file, but at this point, I’ve ripped 851 songs and would like to find a way to do a mass reorganization of these files into appropriate album/artist directories. I believe embedding ID3 tags into the files, would facilitate this, but I’m not aware of an exiting method of accomplishing this. Any ideas?

Thanks,
Jim

Error #1: Using WAV file format. While there are valid arguments for ripping to WAV files instead of AAC or MP3, I can think of no good reason not to use AIFF instead of WAV. WAV is a file format, not a music format. WAV can consist of AIFF streams, PCM audio streams, or other raw data streams. If you are going to save music files, saving them in an appropriate music oriented format is wise.

Error #2: Unless you happen to have an unlimited supply of disk space or a tiny music collection, using AIFF or WAV files is wasteful. If you must use a loss-less encoding format, use ALE (which reduces file sizes by about half). If you’re obsessive and absolutely must have your files in a “standard” loss-less format, then use AIFF, the same format your files are already encoded in on the CD-ROM.

When you factor in the excellent sound quality achieved by even 128 bit AAC, using anything less space efficient than 160kbit AAC VBR gains you nothing in terms of audio quality. Lest you assume that I speak from ignorance, it’ll help to know that I play my music collection directly from AAC encoded files on my G5. The G5 is connected to the receiver via a Toslink (fiber-optic) cable. Speakers are reference grade Ascend Acoustics CBM-170. They have no detectable color (amazing!) and we use them for studio monitors when I’m playing Sound Engineer. When all filters (EQ, etc) are disabled, there is no discernable difference between my AAC files and the CD deck.

Caveat: The only purpose I can imagine for using a loss-less format is to remove the need to re-rip your CDs in the future. When a newer audio format arrives that you want to re-encode to, you simply insert your DVDs of lossless encoded music and use the iTunes -> Advanced -> Convert to ___ feature. This would be less laborious than re-ripping all your CDs. iTunes will encode the songs into your format of choice and replace the previous version of the song in your library. This has the added advantage of preserving all your iTunes metadata, such as listen count, song rating, etc.

Caveat Notes: Even if you proceed this way, you will still want to encode all your files to AAC or MP3. That’s the format you’ll use everywhere. Why? You want your song library to fit on your laptop hard drive, iPod, car MP3 player, etc. Using a compressed format with embedded ID tags such as MP3 or AAC will also prevent the problem that you are facing right now.

Now, what can be done about the existing situation?

The original iTunes library file (~/Music/iTunes/iTunes Library) file still exists on computer A. Since the file hierarchy is completely lost, it’s time for one of two options:

#1 – start over. Discard everything and re-rip. Follow my advise above.

#2 – all the info needed to sort out the files is embedded in the iTunes Library file, as well as the .xml file that iTunes creates. Write a perl script that parses through the file. Back the file up first! The Library file will have paths that look like this:

Music/Library/iTunes/iTunes Music/Nickelback/The Long Road/Someday.wav

The existing paths to the files looks like this:

Music/Library/iTunes/iTunes Music/Unknown Artist/Unknown Album/Someday.wav

The logic for the perl script will look something like this:

   for each file in Unknown Artist/Unknown Album
       check for matching song name in iTunes Library
          if there’s only one match
          create the artist and album directory
          move the file to the appropriate directory

That simple script will correctly identify and move 99% of the files in about 3 seconds. There will be a few songs with duplicate names that will need to manually moved. It’s faster to manually move them than to program the logic to fix them automatically.

I’d write an example script but I have two books to read and a greek exam to study for. This is enough to put you on the right track.

2 thoughts on “iTunes Library Management”

  1. Matt—thanks for the response.

    I ended up re-ripping. What finally convinced me to re-rip was the decision to have the tracks numbered, which I did not do originally. Without metadata or track numbers, even if I knew what albums songs belonged in, I wouldn’t know the track order.

    I’ve already ripped these CDs in the past to MP3 format, with bit rates of either 160kps or 192kps, which I listen to on an iPod—I decided to rip as .wav files in order to create true duplicates of my CDs. After Katrina, I thought it would be a good idea to hook up an external harddrive so that we could store important files. My first thought was Quicken, on which we’ve become fairly dependent, but then my wife suggested scanning important legal documents and putting the originals in a safety deposity box. I know that important stuff should also be saved to CDs, but I figured using an external harddrive would allow us to grab it up at the last minute.

    When Rita was on it’s way to Houston, I purchased a 250GB harddrive and after making sure we had a recent backup of Quicken on CD, I hooked up the harddrive, copied over the entire Quicken directory in addition to the backup file, and then copied over all the digital pictures I’ve never put on CD. We had already made the decision to stay in Houston, so if we did have to evacuate, it would have truly been at the last minute and I don’t know that I would have been able to take the computer, but grabbing the external drive would have been easy. If I ripped .wav files, I’d have duplicates of our CDs, so I’d be taking along our CD library if we ever evacuate—-I love music, but in an emergency, grabbing the CDs themselves aren’t a priority. As is stands, I’ve got space to spare on the external drive. I know I could take my existing MP3s and create audio CDs (I also backup my MP3s on the drive), and it might be in my head, but I don’t like the sound of MP3s that have been converted back to audio CDs (at least in my car, which is where I listen to CDs). With the .wavs, any audio CDs burned should be identical to the originals (minus CD text, I suppose).

    Thanks again,

    Jim

  2. Matt,

    I there any chance you could assist me situation described in this posting with a complimentary Perl script to alleviate the wav file library management issues?

    I too have encountered this very dilemma. While I have become so dependent on digital storage music storage I have also disregarded some basic security best practices principals- like utilizing a second HD drive for system backups.

    Your knowledge and understanding of the situation along with your coding/scripting capabilities would be greatly appreciated at this time.

    Please let me know.

    Thanks,
    Mark

Comments are closed.