How do I automate editing of metadata for a large number of music files?

3

1

I am disappointed with iTunes' support for organizing classical music. When listening on an iPod/iPhone/iHome device, it displays the artist, album and song title. I don't see an option to view composer. As a workaround, I have started to title my songs as follows:

ComposerLastName: Piece - Movement #, Op. #

All my composer data in iTunes is the following format:

Last name, First name (year of birth-year of death)

I would like to automate a process in renaming all my classical tracks in the following manner.

if (genre == classical)
    trackTitle = composerLastName + ": " + existingTrackTitle;

Does anyone know how I could achieve this? I have varying music formats, .mp3, .m4a and some .flac

robert.ecot

Posted 2013-03-03T21:52:58.320

Reputation: 133

I was looking at your question and trying to think how to reword the title into a question (like it should be), and was at a loss as to what in particular you were trying to do. Either, you're trying to sort things by composer, or you're trying to rename things with the composer out front to make them clear. I'm not sure which it is. – killermist – 2013-03-03T23:06:35.153

1I'm trying to rename titles so it's clear from the track name who the composer is. And my apologies, I'll be more careful with naming posts in the future. Thanks for letting me know. – robert.ecot – 2013-03-03T23:14:23.600

1Cool. And I didn't mean you any offense. Now that we know what you're looking for, did you want to edit your title to a question, or would you like me to do that? (or I guess someone else could do it while we're discussing, possibly) – killermist – 2013-03-03T23:19:08.370

Answers

1

If you're comfortable with a little bit of Python scripting, the EyeD3 library lets you manipulate audio metadata. The script would look something like this:

import glob, eyed3

audiofiles = glob.glob("*.mp3") + glob.glob("*.m4a") + glob.glob("*.flac")

for file in audiofiles:
  f = eyed3.load(file)
  if (f.tag.genre == "Classical"):
    f.tag.title = f.tag.composer + ": " + f.tag.title
    f.tag.save()

Although actually, from reading the documentation, it looks like EyeD3 might only work with mp3 files.

MikeFHay

Posted 2013-03-03T21:52:58.320

Reputation: 2 334

My Python skills should be decent enough for this. If I can't find support for non-.mp3 files, I could always batch convert using iTunes. Thanks! – robert.ecot – 2013-03-04T14:53:06.667

2I might be wrong, but I think converting m4as to mp3s is liable to cause a noticeable degradation in quality. – MikeFHay – 2013-03-04T16:43:52.653

Yeah, I was afraid of that. This topic is low on my priority list, but I'll be looking into it eventually. I will update this thread accordingly. – robert.ecot – 2013-03-04T16:49:01.763

4

Although your question is related to iTunes, I've used MediaMonkey for organising my Classical music library. It has the fields you require, such as composer, conductor, etc. Much less hassle than faffing around with iTunes, and it will sync to your iPod/iPhone or whatever devices you require.

From their features list:

Automatically organize and rename music / video files on your hard drive into a logical hierarchy. Instead of storing your files haphazardly all over your hard drive, MediaMonkey’s auto-organizer can organize them into folders and filenames of your choice based on attributes such as artist, album, track title and track number; or series, season number, and episode number.

If you need to organize a media collection exceeding 10,000 files, MediaMonkey is the movie / music organizer for you.

MediaMonkey track properties menu;

Media Monkey track properties

As an added bonus MediaMonkey separates your regular music collection, with those musics tagged Classical. This enables MediaMonkey to set different playback qualities, such as seamless playback, and also configure the track view to exactly how you want it.

MediaMonkey Classical Music node

MediaMonley Classical Music Collection Properties

Finally the Classical collections playback properties being edited.

MediaMonley Classical Music Properties Menu

wonea

Posted 2013-03-03T21:52:58.320

Reputation: 1 737

Thanks, I'll give MediaMonkey a chance. It's not an ideal solution for me, as I use house sharing and other features of iTunes. – robert.ecot – 2013-03-04T14:53:35.213

I use MediaMonkey's DNLA for sharing music across devices. I can access my music on the Playstation 3/Phone, which is okay for browsing and playing music in the lounge. You could also investigate using XMBC if you wanted to access your music cheaply from other devices - Raspberry PI? Anyway the world is your oyster, enjoy! – wonea – 2013-03-04T19:22:10.910