batch renaming iTunes directories

In partial response to the Ask Metafilter question “How can I rename my music folders on my Mac based on ID3 tags?“:

#!/bin/bash
# itunes_sanity.sh - fix dir names created by iTunes
# only works for mp3s, and not actually tested on a Mac
# created by scruss on Sun Sep 4 22:05:00 EDT 2005

find "$@" -type d -mindepth 1 | while read directory
do
  artistdir=$(dirname "$directory")
  firstfile=$( find "$directory" -type f -iname '*.mp3' | head -n1 )
  year=$( id3info "$firstfile" | egrep ' TYE ' | sed 's/=== TYE (Year): //; s/[^0-9]*//;' )
  album=$( id3info "$firstfile" | egrep ' TAL ' | sed 's,=== TAL (Album/Movie/Show title): ,,;' )
  echo mv \'$directory\' \'$artistdir/\[$year\] $album\'
done

So if you were in the terminal, in your music library (one up from the individual artist directories), and you did:

itunes_sanity.sh Dan\ Jones Tripping\ Daisy

you’d get:

mv 'Dan Jones/Get Sounds Now' 'Dan Jones/[2005] Get Sounds Now'
mv 'Dan Jones/One Man Submarine' 'Dan Jones/[2003] One Man Submarine'
mv 'Tripping Daisy/Jesus Hits Like the Atom Bomb' 'Tripping Daisy/[1998] Jesus Hits Like the Atom Bomb'

If that looks okay, run the output through the shell:

itunes_sanity.sh Dan\ Jones Tripping\ Daisy | sh

and all should be well.

You’ll need id3lib, which is probably most easily installed from Fink. Also, this only works for mp3 files; I can’t grok the tag info for AAC files. And finally, this might go seriously screwy on weird characters in filenames. You know my feelings on that …

1/9/XX, and the smell of new pencils

Although school in late August for us I always derived the tiniest bit of pleasure from writing the date today, and seeing that it was the same as the year. This shows I was educated in the last century.

As it was the start of the schools year, I was writing with new pencils, and summer holidays were long enough for me to forget their wooden smell. So I remember writing the date, and simultaneously, the smell of new pencils.

clicking like the trilobite

clicks in my H120 recording
Darn it, but my iRiver, with this recent firmware upgrade, now records a click about every minute it records. See the regular peaks? It hasn’t completely ruined my recording of Of Montreal, but it hasn’t helped.

(and apologies for the relatively huge file size of the image; I’m just learning my mac-fu.)

and I thought that it’d hosed the recording of the encore by killing the wav file header. But some digging with sox parameters fixed it:

sox -V -t .raw -s -w -c 2 -r44100  broken.wav fixed.wav

yup

So I bought the iBook. So far, it’s plain sailing — but then it should be.

ididn’tBook

For a truly soulless evening, take yourself down to the BestBuy at Scarborough Town Centre.

STC is a mega-mall, with the obligatory huge concrete and asphalt deadzone around it. Its current sales slogan is For what defines you, which must mean that its denizens are in a pretty parlous state, existentially speaking. Its only slightly attractive feature is its derelict KrispyKreme store, which opened as a flagship, then frazzled almost as quickly as a KK’s dextrose rush. Abandoned donut shops are Canada’s ruined abbeys; places of worship gone to seed.

BestBuy itself is an outcast from the mall, in an especially ped-unfriendly way. Perhaps the only defined route there is through a monster split-level Wal-Mart, but I didn’t have enough hitpoints to make it through that particular slough.

I’d checked their website, and it said that the store had iBooks in stock, at $50 below retail. Did the store have any on display? No. The Apple section was set behind the customer service desk, which was a scrum of slightly disgruntled shoppers. So I left without seeing one.

I wandered in a bit of a post big-box haze to McCowan RT, a weird little station at the very end of the rails. At least I was rewarded with a beautiful sunset over the 401 at McCowan; all boiling red and purple. That’s about the best you’ll get near STC, and for free, too.

windfarm or wind farm?

So how do you write it?

I use the former. Some people might say that the latter is more correct (one doesn’t refer to a pigfarm, after all), but we’re not really farming wind here. That we leave to the bean farmers (hohoho; I do believe that was the very same joke that Lord McAlpine used to use when showing bigwigs through the RES Ltd office in Hemel Hempstead).

I’d really prefer to use the term windpark, using the original meaning of park for an enclosed field. I guess it’s a bit European for most folks here, so it’s windfarm for me.

(One shouldn’t confuse a windfarm with WindFarm, the toolbox of choice for the leet wind haxx0r).

my wind-powered PC

As a thank-you for speaking at the ESC/EWB Power Shift lecture series, I was given a Pembina Institute Wind Powered PC tag. That means that the energy equivalent of three years of PC usage has been bought for me from a windfarm.

I’d like to thank the folks at UofT for putting up with me for the evening, and buying me dinner at the (in)famous Peel Pub (would that be innfamous?). I enjoyed it, and I hope they did too.