iTunes Preparation

For the past ten years I have converted most of my CDs to MP3 format and, gradually, a sense of order has evolved. Now I have my collection sub-divided into the following folder structure: d:\mp3\artist\album. This is all good and well but the ID3 tag information in these files isn’t as pretty as my nicely-ordered folder structure, which became apparent when friends, family, and colleagues wouldn’t shut up about the virtues of iTunes and I tried to import my collection.

What I once regarded as a lovingly-ordered collection of music was reduced to rubble when iTunes tried to make sense of it all. It seems that I never before cared enough about ID3 fields in Winamp which resulted in iTunes separating “JS Bach” from “Bach” and “Bach, JS”. Needless to say, I was not impressed, and quickly discarded iTunes. However, I have grown tired of navigating through my folder structure in Winamp’s standard Windows common dialogue, so I have finally done something about it and have written a program to tidy-up my entire collection. Introducting: iTunes Preparation.

To get the most out of iTunes Preparation, you should start out by making sure that your folder structure resembles mine -i.e., My Music\artist\album. If yours differs from this format, then iTunes Preparation won’t do you any good (unless you download the source code and modify it to suit). The other thing you should do is create a bunch of text files (I created “classical.txt”, “baroque.txt”, etc) and copy them, as appropriate, into the each artist’s folder. As iTunes Preparation goes about its business, it will use the name of the first (and, hopefully, only) text file in the artist’s folder (minus the extension) as the genre for all MP3 files in that folder and any sub-folders (albums) below each artist. Here’s a full list of what iTunes Preparation will do:

  • The top-level folder (My Music\artist\album) is regarded by iTunes Preparation as level 0 (this is just FYI, and will make sense if you intend to modify the source code yourself).
  • The first-level folder name (My Music\artist\album) will be used to update the name of the artist for all MP3 files in that artist’s folder (and albums below that).
  • The second-level folder name (My Music\artist\album) will be used to update the album for all MP3 files in that album’s folder.
  • iTunes Preparation will not dig any deeper than the second-level.
  • The name of the first text file found in the first-level folder (artist) will be used (minus the extension) to update the genre.
  • If an MP3 file contains both an ID3 v1 and ID3 v2.3 set of tags, the v1 set are removed and the v2.3 set are retained/updated.
  • If an MP3 file contains no ID3 tags whatsoever, the file is ignored.
  • iTunes Preparation does not add any junk data to your MP3 files, such as “edited with iTunes Preparation” or anything unwanted.

To demonstrate what difference the album field makes (and to understand one of the major reasons I created iTunes Preparation in the first place), consider these two screen captures of iTunes:

(Picture: before specifying MP3 album field)

Before: the first movements of each performance of Beethoven’s 5th are listed together, then the second movements, etc. It’s not easy to tell them apart.

(Picture: after specifying MP3 album field)

After: each recording of Beethoven’s 5th now is easily distinguishable; I can listen to Klemperer’s recording, then Zinman’s, without jumping back and forth between them both.

Before tidying up my MP3 collection, iTunes listed one category (Classical), a bunch of composers with names in various formats, and, the greatest sin of all, each recording of a symphony would show the first movements together, then the seconds, thirds, and fourths. It wasn’t easy to listen just to Klemperer’s recording, for example. I had to either drag each movement into a special playlist, or just put up with it. After running iTunes Preparation over my collection, iTunes now displays a music library that doesn’t make me think unhappy thoughts, which is a good thing.

To run iTunes Preparation:

  • Make sure you have the Microsoft .NET Framework Version 2.0 installed. If you’re not sure, you could try skipping this step, but, if it doesn’t work, you’ll have to install the .NET Framework.
  • Download, unzip, and run “iTunesPreparation.exe” which is contained in the file.

To modify iTunes Preparation:

Feel free to leave any comments/success stories below. There is absolutely no warranty for iTunes Preparation. I created it to suit my own needs, and get the feeling that it may prove useful to others as well (particularly those with a large classical music collection). Before running it, I suggest you make sure that your music library is backed up and that you also perform a dry-run on a small selection of your library copied to a different folder.

By the way, if your music collection already has been added to iTunes, you’ll probably need to remove them from iTunes, run iTunes Preparation, then re-add the folder containing your music library. Good luck.