26 January 2014

Adventures in Music Organization, Part I

Our story begins with a hard drive failure. This may have been a while ago, and most of my things were backed up. However, my ongoing grudge has been with my music collection.

I had an iPod with all my music intact, which you'd think would be a saving grace, but...

Thank you iPod naming conventions!
...it may have destroyed any semblance of logical structure to its folder and file naming scheme.

It's not even grouped with similar artists/albums together.
Now, if I pointed iTunes to my entire music collection, then it's all fine. In fact, I believe even Windows Media Player can open them just fine, and the song titles, albums, artists, date of conception, etc. are all intact. It's just the folders and file names that are borked.

You could just say "deal with it" since it no longer matters when music players can read all the tags and whatnot, and I did. Until the onset of games that use your music collection.

Although I have done a good job without organization. Beat Hazard, yeah!
Beat Hazard in particular uses the file names until you highlight a song. Then it starts to load it and updates the name to match the title. This is tedious. I enjoy tedious tasks sometimes, but not here.

Want to play a specific song? Good luck.
I'm sure there are music organizing programs already in existence, but I'm a programmer, and I want to be stubborn about this problem. After all, it's my problem and I want to solve it. It sounds conceptually simple, right?

If I want to do this quick, I'll start with C#, since I can just drag a couple buttons around. It only takes a few minutes to come up with this:

All music files are pulled, so... now what?
However, I've never tried to pull metadata from a file before. I was guessing there might be something in FileInfo to do it, but apparently there isn't. So how do I get this?

As my searching found out, music files have something called an ID3 Tag. Unless I chose to create a Windows 8 App, C# doesn't appear to have a built-in solution for reading these tags. I don't wish to go the Windows 8 route, so a solution to this problem is going to be more involved than I was expecting.