»  Fast ID3 tagging

This is solely for my friend saper who was recently telling me how much he loves it when people post snippets of code that they come up with during their everyday lives, even if they are relatively pointless in the grander scheme of things. Well, today I was listening to a few old mp3 files while coding more important stuff and realised that some had no id3 tags, which was a good excuse to put good ol’ PERL and some shell magic to some use to tag them all, fast. Here’s the two-minute script for tagging files based on the filename (note the ‘[trackno] – [title].mp3′ regex). I ran the script twice, once for the trackname and once for the track number (not shown below, is trivial and left as an exercise for the reader). Hope this is useful to someone, although I guess it mostly serves as proof as to how much you can do with one line of PERL/shell scripting magic. Enjoy =)

ls *.mp3 | while read f; do TRACKNAME=`echo "$f" | perl -e '$a = <STDIN>; $a =~ /(\d\d) - (.*).mp3/; print $2;'`; id3 -t "$TRACKNAME" "$f"; done

4 comments


2008.08.30

Mistagged? Misprogrammed.

I regularly listen to last.fm radio stations, be it from my friends, neighbours or people that I stumble upon by checking out groups that may interest me.

One of the problems I’ve noticed is that music that Last.fm serves over its radio is sometimes mistagged; the problem is that the Last.fm software seems to identify this, but does nothing other than inform you that this is the case. Somewhat ironic, given that Last.fm is serving this music. Check out the screenshot below, from the Last.fm client playing the ‘Dance of the Blessed Spirits’ by Christoph Willibald Gluck. That’s the ‘baroque’ tag ‘radio station’.

Mistagged music on the last.fm radio.

This is not an isolated occurrence. I ran into the problem twice in the few minutes it took me to write this post. Which begs the question: last.fm warningWhere does Last.fm get the music it’s serving to its users? I thought the company had agreements with most of the mainstream record companies and a bunch of indies and that’s where it got hold of the music. Wouldn’t this mean that they have all the necessary meta-data in place when they stream audio over their ‘radio’ stations? It makes no sense for last.fm to serve music with bad tags, let alone advise its users to keep their tags clean in the process.

comments

Download Spinalonga's Podsafe rock music for your podcast. From Athens, Greece, with love.'