iTunes’ “Shuffle” is repeatable!

For years now I’ve been getting frustrated with iTunes’ seeming repetitiveness when listening to music with ‘shuffle’ turned on. I find ‘Album Shuffle’ a pretty good way to listen to music: just select the album you want now and a random album will be cued up in due course. (Listening to full albums is, of course, the only way to properly listen to music.)

You’re not stuck with the interruption of choosing what to listen to next (without getting stuck into listening ruts at the same time), and of course there’s nothing stopping you from skipping the album if you’re not in the mood.

Every now and then I’d realise that after going back to a previously-played album that I wanted to listen to again, the next album that started playing “randomly” next was in fact the same one that started playing next last time. I’m not the only one to have noticed this.

Try it out for yourself. Turn on Shuffle, with ‘Shuffle: Songs’ checked in the Playback preferences. (You get the same problem with both albums and songs.) Start playing a song and hit ‘Next song’ a few times. Keep track; here’s me:

  • Down By The River, Live At The Fillmore East, Neil Young & Crazy Horse
  • Les bras de mer , Le phare, Yann Tiersen
  • The Believer, Chrome Dreams II, Neil Young
  • Everything Will Be Alright, Hot Fuss, The Killers
  • A Drop in Time, All Is Dream, Mercury Rev

Now go back to, say, the second one, and hit play. Hit next song. Wouldn’t you know?

  • The Believer, Chrome Dreams II, Neil Young

Just to prove it wasn’t a fluke, hit next again:

  • Everything Will Be Alright, Hot Fuss, The Killers

I don’t know about you, but I find this behaviour incredibly (a) annoying, and (b) stupid.

Sure, you should be able to retrace your steps backwards in the random sequence. But under no circumstances should I be subjected to the same random sequence if my only crime was to want to re-listen to a particular favourite.

In Apple’s internal database, this is bug #6033030.

Applescript for iTunes: ‘Next Album’

Here’s an Applescript I like to use. I listen to iTunes with ‘Album Shuffle’ activated, so I don’t have to think about what to listen to next. (And, embarrassingly, to keep the music going after an album finishes; if I’m thinking about something when the music stops, I’ll totally forget that I had music going in the first place and sit in silence for hours.)

The problem is that sometimes you don’t want to listen to a particular album. And there’s little worse than hitting ‘Next Song’ a dozen times to skip to the next one. Luckily, iTunes is rather scriptable:

tell application "iTunes"
    set |current album| to the album of the current track
    repeat while the album of the current track is equal to |current album|
        next track
    end repeat
end tell


The New Yorker's straight quotes

Usually The New Yorker is the epitome of good and consistent typographic design. Oops:


Note that they’ve got it right for the running text, but for whatever reason the quotation mark in the lettrine remains uncurled.


Mathematica packages of mine

A couple of years ago I picked up Mathematica to use for some of my PhD research. And I quickly grew enamoured to its programming style and mathematical capabilities; as opposed to Matlab, my other tool of choice, which acts like and (mostly) has all the grace of a glorified number cruncher.

Since using Mathematica I discovered a few things it can’t do so well and wrote some packages to help myself along. The cost-benefit time ratio was heavily skewed against me, but what the hell. In for a penny, in for a pound. I could hardly ditch Mathematica because it couldn’t output graphics (say) in a form I felt to be sufficiently suitable.

Now, Wolfram has a site set up as a centralised repository of Mathematica code: the Wolfram Library Archive. At present I have three packages that live there:

(I don’t, sadly, have time to elucidate their existence right now. Some pretty pictures would be nice.)

The terrible shame, however, is that Wolfram has a huge problem actually updating those sites. A few months ago I sent them updates to these packages and I’ve yet to hear any reply. It makes my life hard if I need to pay attention to whether people are even able to access the most recent versions of my code. Frankly, I’m far better off hosting the code myself.

(Cue suppressed announcement of a long overdue actual website that I’ll one day create but which is on ice until I finish my PhD.)

So here I’d like to point you all to the canonical repository for this work (and any future work as well): wspr/mmapkg at GitHub. It contains the three packages above in addition to a couple of other packages that aren’t as generally useful (yet).

I’d recommend that you use these links instead of the Wolfram ones; who knows how long it will take me to update the Wolfram library versions if it takes so long for them to get back to me. I understand the time constraints, but really. CTAN (for TeX and LaTeX code) is staffed by volunteers and they usually check and upload packages for me within 24 hours.

The other advantage to using GitHub for this sort of work is that it makes things easy for anyone interested in using these packages to make changes and fix bugs in my code.

Since posting the original versions at various times I’ve collaborated with two authors on two packages respectively to improve the features and performance of the code. It’s just so rewarding working in collaboration with people I’ve never met because we share some sort of passion with this tiny piece of code.

While I don’t expect any of the readers of this site to actually be using Mathematica (shout out if you are), hopefully Google will render the information here useful to some people at a later date.

Update: Mike Croucher has made his own announcement of the new version of ColorbarPlot with a great explanation of what’s new and — even better — some pretty pictures.

Update the second: The most recent versions of the packages are now (finally) available at the Wolfram Library (16 July, 2008).