Happenings

On Organising Music

People tend to build up systems for organising their data only after it’s really needed: we’ll gather related objects together haphazardly until it’s too late and we end up with a clutter. Nowhere is this seen more frequently than in people’s digital music collections.

Invariably, people just shove all of their music into a folder and hope for the best, neither organising or normalising the data. The result is that it’s difficult to find specific files, many files are missing vital metadata (like the artist name), and doing anything takes far longer than it should.

This need not be the case.

I’ve shown a few people who have been interested in organising their music collections the strategy I’ve built-up for keeping clutter free, and I’m going to share it with you. It’s not perfect, but it works well for me. (To be honest, I’m writing this so I can point anyone else who asks towards this guide.)

First of all, if all of your music is relatively popular and well known and you already use it as your main media player, just use iTunes. It has many shortcomings, but if you fit in that sweet spot then save yourself the hassle and just let iTunes take care of it all. That’s it, you lucky ones can go now. Lesson over.

Still here? Great. For anyone who has explored the world of music beyond iTunes, you’ll know that it won’t help fix your metadata or organise your music in a particularly useful way. My solution to that is built largely on top of the tools and music database provided by MusicBrainz, a collaborative way of discovering music metadata.

A little background: MusicBrainz aims to be the definitive reference source for online music. Over the last few years, volunteers have gathered a tonne of music metadata onto the MusicBrainz website and set about organising it. There are artists, releases, albums, singles, release groups, collaborations, and every piece of music information that you could need; all of it tagged with unique IDs. I say “every piece” but that’s overstating it. There will always be gaps in what MusicBrainz knows. The good news is that if you spot a missing release from your favourite artist, you can add it to MusicBrainz yourself and then everyone else gets to benefit from it.

Back to the task at hand. You’ll need to grab Picard, the MusicBrainz tagger, from their website. It’s available for Windows, OS X and Linux; and it’s ugly as sin on all of them. Seriously, it’s a terrible looking tool, but it’s very useful.

Once you’ve got Picard, the rest is easy:

  1. Create a Music folder – This should be empty at first, and represents the golden copy of your data. Absolutely nothing gets in here that hasn’t been properly tagged and vetted. It can be anywhere you like, but keep in mind that you’re going to want to back this up on occasion so keep it somewhere that makes that easy.
  2. Set-up Picard – In the Picard preferences, there is a setting for moving tagged files to a specific directory. Pick your new Music folder. You may also want to change the filename format and tweak some of the other settings, but I leave that up to you. Personally, I use “artist/release/artist – track title.mp3” for filenames.
  3. Add music to Picard – There are a few ways of doing this, but you can drag and drop music directly into the left-hand panel, or use the add files/folders buttons. If you’ve added music from several albums at once, you probably also want to hit the “Cluster” button. This will attempt to organise the files into groups of untagged releases.
  4. Search for a matching release – Select the music you want to tag first, and hit lookup. Musicbrainz will try to use the file’s existing metadata to find a release that matches.
  5. Save your matches – If the release it finds looks correct, then save it. Your files will be tagged with all the extra metadata MusicBrainz knows about and an ID so you never have to match it up again, and moved to your Music folder. Once saved you can them remove the release from Picard altogether.
  6. Scan your misses – If MusicBrainz either couldn’t find a match or the match it finds isn’t correct, you can use the “Scan” button to try a different approach. This uses audio fingerprinting (like Shazam) to try and automatically match the music using the audio itself.
  7. Search Manually – Use Picard’s manual search to try and find the right release. If you find it, a “Tag” button will appear in the top-right of the release information. Click that, and the release gets imported into Picard so you can drag the music onto it yourself.
  8. Do It Yourself – Still no luck? Well, it’s time to get acquainted with the MusicBrainz website to add the artist and/or release yourself. This is pretty straight forward but there’s plenty of information on how to contribute. If you think your files already have some of the data you need to add a release, there is a Picard plug-in for creating a release from a Cluster too.

That’s it. Every time you get new music, follow from step 3 and you’ll keep your golden copy in good shape.

As a bonus, if you ever decide to reorganise your Music directory, you can import your tagged music into Picard and it’ll recognise all it. You can then make whatever changes you want (maybe change the filename format) and re-save.

If you happen to be on OS X then the Max CD ripper can automatically tag your files as it rips, as it has Musicbrainz integration. You set it up in the same way as Picard and query MusicBrainz before ripping to pull back all of the metadata.

Hopefully, this will be of some help to someone in organising their music and understanding MusicBrainz.

Jdbc and Enums

After months of using JPA/Hibernate almost exclusively, I got caught out on a relatively simple bug when using JDBC more directly (well, via Spring’s JdbcTemplate):

public List<SomeObject> fetchSomeObjects(RecordType recordType) {
  Map<String,Object> params = ...//Map creation;
  params.put("recordType", recordType);
  return namedParameterJdbcTemplate.query("select * from someObject where recordType =  :recordType",
    params,
    someRowMapper);
}

That was from memory, so it may be a little off, but it should give you the basics of what the code was doing. It looks okay to my eyes, but, of course, it wasn’t. When run an exception was being thrown from the bowels of the JDBC code saying that RecordType couldn’t be converted to a JAVA_OBJECT.

Odd, I thought. It had worked perfectly well with an in-memory database (HSQL) but now wasn’t working when deployed on a hosted database (SQL server).

I couldn’t spot it straight away, so a quick debugging session revealed the problem: JDBC doesn’t play nicely with enums. RecordType, an enum, was being passed to JDBC verbatim without any attempt for it to match up with the recordType column (a varchar column); and that just doesn’t work. You need to explicitly convert from an enum to a String.

Thankfully, it was a one-line fix:

params.put("recordType", recordType.toString());

It doesn’t read quite as neatly but it works. The fact that the original version reads quite well (the value for “recordType” is called recordType) actually makes the bug harder to spot. Now, back to JPA.

Film Fight 2011: January

It’s 2011 and time for a new Film Fight. I’ve been considering changing the format this year, but have decided against that for now so it’ll be the usual: a paragraph or so for each film, with the best selected as the month’s winner. All the winners are compared, and the year’s film is selected. Easy.

January is always a packed month, with Oscar-baiting meaning that the quality is kept suitably high. In January 2011, there are six movies to be reviewed.

First up, is It’s Kind of a Funny Story: an indie film that tries to show how mental illness can affect anyone and is easily misunderstood by non-sufferers, by taking a slightly comedic look at the issues. It doesn’t go far enough in it’s exploration of the issues, often opting for shorthand and stereotypes to make it’s points, which is somewhat disappointing. It does, however, move the plot forward at a good pace, balancing comedic elements (Zach Galifianakis plays a big part, but more does so more seriously than usual) and a romantic subplot with relative ease. It’s not a classic, but it’s a good, kind-hearted film. (See my It’s Kind of a Funny Story Twitter review).

The King’s Speech humanises King George VI in a way I hadn’t thought possible. By focussing purely on his speech impediment and his years of suffering and humiliation because of it, we begin to see him as a sympathetic man, rather than purely as an elite Royal. He is, of course, both, and it’s to the filmmaker’s credit that they manage to get this across so clearly. This is successful in large part due to Colin Firth’s fantastic performance; the crushed dignity of the soon to be king made clear in every embarrassed look and stammer. An excellent film. (See my The King’s Speech Twitter review).

Blue Valentine is almost an anti-love story. It doesn’t focus on things being difficult and then working out. No, instead it contrasts the beginning and end of a relationship, showing a couple at their worst. Communication break downs at the end of a marriage are intercut with two younger versions of the leads with hope and kindness trying to find their place. It’s sad and well-done, if a little slow. It does a remarkable job of showing how people change. Worth seeing. (See my Blue Valentine Twitter review).

127 Hours does some unexpected things, not least of all because of what everyone expects from the premise: a climber (played by James Franco) is trapped by a boulder against his arm in a cave and, over several days, is forced to make a very difficult decision. Despite being on his own, and their being relatively little dialogue, Franco brings out an extremely likeable character that you want to get out of this hopeless situation. Every tiny triumph and minute failure will see you gasp in just the right way. When the inevitable happens, the film has really earned it’s most painful moment. A few moments aside, this is a very good film. (See my 127 Hours Twitter review).

Darren Aronofsky has another classic on his hands with Black Swan, the tale of seeking out perfection when the pursuit itself makes perfection much more difficult. Natalie Portman is excellent as a ballerina who practices obsessively, even when her obsession – her madness – stops her from seeing the world correctly. It’s surreal, dark, sensual and unnerving: we’re never allowed to know how much of what we see is real and what is imagined. I won’t spoil it, but the ending is excellent: finding the right mix of closure and mystery to round out an altogether astounding movie. Very worthwhile. (See my Black Swan Twitter review).

Finally, NEDs shows how one young boy is repeatedly failed by those in authority around him, forcing him down the path he’s been trying to avoid for years. We see his fall into violence and crime, despite his brightness, and can imagine how it could have been avoided if people had acted with a little more kindness and less judgement. NEDs, then, is a morality tale; a look a reaping what we sow and then blaming the crops for withering. Brutal in places, but a stunning watch. Very good. (See my NEDs Twitter review).

As I mentioned in my preface, there are a number of good films this month. Five of the six would easily have won in other months (and the sixth, It’s Kind of a Funny Story, would’ve done well in some). If forced to watch just one again, I’d pick Black Swan; and that’s why it’s the first winner for 2011.

Film Fight 2010: Finale

As always my caveat from previous years still apply: Film Fight is a knock-out tournament and, as such, will only select my favourite film. It makes no guarantees about any other place.

First, good films that didn’t win their month:

  • Up In The Air
  • A Prophet
  • Precious
  • Shutter Island
  • Kick-Ass
  • Green Zone
  • Predators
  • Toy Story 3
  • Scott Pilgrim Vs The World
  • Cyrus
  • The Other Guys
  • Winter’s Bone
  • The Social Network

And then the monthly finalists:

  • January: The Road
  • February: A Single Man
  • March: Crazy Heart
  • April: Crying With Laughter
  • May: Four Lions
  • June: Rec 2
  • July: Inception
  • August: The Expendables
  • September: Dog Pound
  • October: The Town
  • November: Let Me In
  • December: Megamind

Last year had a number of really strong contenders as finalists, with only one film sneaking through. Sadly, that’s not the case with Let Me In, The Expendables, and Rec 2 all getting through when they might not have in another month (possibly Megamind too, but it’s fun).

That said, there are still a number of very strong choices in there. I’d strongly recommend the rest, but need to pick out a few.

4th place goes to Crying With Laughter, for it’s dark comedy and bleak look at one man’s life.

3rd place goes to Dog Pound: it’s such a well-paced film, constantly raising the feeling of menace until the final act unleashes it all at once.

2nd place: I’ve debated back and forward on this and the first place a few times. I’ve even switched them around in various drafts of this post, it’s that close. I think, though, that the second place goes to Inception. While many will get stuck on the special effects, which are quite extraordinary, it’s the storytelling structure that is the real key to this film. Multiple stories, in multiple timeframes, all happening at the same time and interacting with each other; and rarely missing a beat. That’s an accomplishment on it’s own. The fact that multiple viewings reveal more, and there are many more stories left untold leave this as a real masterclass in structure.

1st Place: That means that The Road is the Film Fight winner for 2010. It’s bleak, agonising, and quite desolate, but such a strong vision of a world where a man is compelled to protect the only thing that matters to him, his son, and the consequences of being so single-minded. A classic.

Film Fight 2010: December

As is normal at this time of year, there’s not much out that looks worthwhile so I’ve only seen a few films this month.

First up, Megamind is the superhero story we’ve all wanted to see for a while: the one where the evil villain and his dastardly creations finally win out and defeat the hero. Megamind is about the loneliness of a villain with no hero to fight. From that point onwards, the story is fairly predictable but fun, built around a number of parodies and sight gags. The highlight is probably Will Ferrell’s Marlon Brando impersonation, but there are a bunch of other neat little moments. It never manages to raise itself to the level of a classic animated film (like Toy Story 3), but is good enough to watch at least once. (See my Megamind Twitter review).

The Tourist, however, is not good enough to recommend watching even half of it. It’s a truly terrible film on almost every level. It looks pretty and has a strong cast, but they’re squandered here on terrible dialogue and a formulaic, “twisting” plot. You’ll see the twists coming, you’ll cringe at the ropey lines, the heavy-handed spoonfeeding of information, the seen-it-all-before action set pieces, and the overacting. I can’t recommend this at all. Terrible. (see my The Tourist Twitter review).

The winner is Megamind. Not because it’s a classic film, more because it didn’t have any competition.