Friday, May 25, 2012

Efficiently Rate Your Music Collection Into Submission

The Problem

I want to rate the tracks in my music collection efficiently. The ratings can be used to:
  1. Generate playlists
  2. Remove music I don't like
  3. Share music that I like with friends
  4. Pick the music to be synced across my devices
The problem is that there are too many steps to rate music as you listen to it.  It's a perfect multitasking activity, but most media players don't provide anything out of the box to help you keep on task.  The standard workflow is to switch to your media player, rate the currently playing track, select the next track to play, and then switch back to what you were doing.  That's four steps!

In reality, you get sucked into spending most of your time in the media player because of tracks that rate poorly.  Those sad tracks tend to come in groups, especially on albums with the typical quota of one to three good tracks.  So, instead of thrashing back and forth between your media player and your work, you stay in the media player waiting to get to a track you are willing to listen to for a while before rating.  Eventually, you start enjoying a track too much and forget to rate it or you simply find the idea of breaking your train of thought yet again too frustrating.  So you give up.  You're left with a handful of tracks rated and one more promise of technology unfulfilled.  Before you know it, you spend all of your time on Pandora, last.fm, or Spotify and you try to forget all of that time you spent ripping your music collection to mp3s. :)

Well, I think there's some hope.

A Solution

How about being able to rate the currently playing track and start playing the next unrated track without ever having to leave your work, and do this in one step!?  It's as good as it gets, I think.

Here's a guide to setting up global keyboard shortcuts and voice commands on a Mac to rate your music in iTunes.  Between hotkeys and voice commands, you should be able to rate music easily in any scenario.  I'll try to follow up with a Windows guide later.  If you don't like iTunes, you should be able to apply the basic concepts here using just about any media player.

Here's an outline of the steps:

- Configure iTune to show half-star ratings (ex. 3.5 stars).
- Install AppleScripts that automate iTunes. I provide the scripts below.
- We'll place the scripts in a special folder for speech commands and name the scripts properly to turn them into voice commands.
- For global keyboard shortcuts, we'll install a great utility called Spark and then configure Spark to use the scripts.
- Create a smart playlist that only includes unrated tracks.
- We'll set iTunes to shuffle and then play our unrated tracks smart playlist. As we go about our normal routine on the computer, or up and about getting things done around the house, we'll easily rate our music using the global keyboard shortcuts or the voice commands. Headphones with a microphone are recommended for voice commands.

1.  Configure iTunes to show half-stars for ratings

First, quit iTunes, then enter this command in Terminal:

defaults write com.apple.iTunes allow-half-stars -bool TRUE

Relaunch iTunes, and you'll find you can now click between the stars (in the Ratings column) to get half ratings.  You can also drag across the stars and you'll see the half ratings.

2.  Install iTunes AppleScripts

Download the scripts I created first. Extract the scripts into the following folder: /Users/{Your Username}/Library/Speech/Speakable Items. One way to access the Library folder is to open the Go menu in Finder and hold down the Options key on your keyboard. Library should now be visible. Choose Library and then navigate to Speech/Speakable Items.

The filename of each script will become the voice command. You are free to reword the filenames, but make sure to keep the file extension in tact (.scpt) as it's needed by Spark in a future step.  Don't worry, the filename extension will not be part of the voice command so there's no need to figure out how to pronounce scpt.

Speakable Items folder

3.  Install and Configure Spark

Download Spark and install it.  It's a really great shortcut key utility for the Mac.

Next, you need to assign shortcut keys to the AppleScripts.

Example Spark Setup
To add the hotkeys:

  1. Click the large button on the toolbar to choose "All Application's Hotkeys" since we want to create global, system-wide shortcuts.
  2. Click the Gear drop-down button on the toolbar and choose AppleScript. This tells Spark that you're going to create a new keyboard shortcut that can be used from any application and it will launch an AppleScript.
  3. In the configuration page that appears, choose the hotkey (I used control+option+function keys for each rating level), name the shortcut whatever you want (it's just to help you identify the shortcut within Spark), and click file then choose the corresponding AppleScript file located in the Speakable Items folder.
  4. Click the "Start Spark Daemon" button.

4.  Create Smart Playlist

In iTunes, choose "New Smart Playlist" from the File drop-down menu.  Then create a rule where Rating is less than 1 star or equal to no stars.  Take your pick.  My rule is for less than 1 star which means it will include tracks that were assigned 0.5 stars.  If I'm undecided about deleting a track, I give it a 0.5 so that it will appear again in the rotation later for me to consider again.


5.  Start Rating Your Music!


  1. Turn on shuffle in iTunes.
  2. Start playing your Unrated Music Playlist.
  3. Test your hotkeys: No matter whether you are in iTunes or another application, you should be able to use your hotkeys to assign a star rating to the currently playing track and skip to the next track immediately.
  4. Enable Speech Recognition in System Preferences. Using a headset with a microphone, try issuing the speech commands to rate tracks.  I find that my voice commands are not well understood if my microphone sensitivity is too high. Make sure to use the mic calibration tool and keep the bars in middle greens.

Supplied Scripts

Along with the ratings scripts, I created scripts for:
  • Going to the previous and next tracks.
  • Going back and forth 30 seconds at a time within the currently playing track.
  • A script to delete the currently playing track and skip to the next track.
I see these as the essential scripts for rating tracks.  You may want to add your own (like scripts that rate the currently playing track, but don't skip to the next track immediately).  To make your own script, just copy and paste one of the existing scripts in Finder, give it a new name, and then double-click it to open it for editing.

Good luck and long live your music collection!


No comments:

Post a Comment