Tag Archives: Music

Shuffling and Randomizing Algorithms for Music Playlists


I’ve been messing around with iTunes and the DJ functionality. It seems like all it does is pick random songs out of the library and shows them in the order they’ll be played (unlike shuffle, which just randomly jumps around). Typically, I like to put my iTunes library on random when I’m listening. This allows me to hear a bunch of different music in my library. If I don’t like a certain song, I’ll skip it, unless I’m not really paying attention.

I find that the most important piece of metadata in my iTunes library is probably “play count.” This is a pretty good indicator of how much I like a song. It’s a bit off sometimes though, since I might really like a new song with a lower play count because I haven’t had a chance to listen to it 80 times. I use a smart playlist that sorts on “play count” to determine which songs to stick into my iPhone on sync since the phone can’t hold my entire music library. Generally it works well. Perhaps there could be another measure like “normalized play count” that takes into account how long the song has existed in my library.

The iTunes DJ is pretty lacking in terms of how you can weigh what will randomly show up next. You can basically click a box that says “play higher rated songs more often.” I don’t rate my songs (the metadata gets thrown away pretty quickly as I move from computer to computer or Mac to PC, etc), so this feature doesn’t do a lot for me. I prefer the implicit rating (play count) versus the explicit rating (star rating) because the implicit way to do it is natural and doesn’t require me to do anything extra.

I’d like there to be a “play songs with a higher play count more often” feature. This could be bad, though, because it’d lead to a sort of rich get richer deal. So weighting would be important. I’d say it’d be a good heuristic to give each song a probability of “(playcount + 1)/(total number of library plays + # of songs)” to be played. That way the more popular songs (the ones I like more) are played more often, but other songs still have a chance to be played as well (and skipped). There might be other better algorithms for weighing songs based on play count that don’t lead to an unnatural skew (which would mess up the point of having the feature in the first place).

Another thing I could do is prune all of the songs I skip most out of my library. I’m too much of a digital packrat to do that, though, so I guess a smarter algorithm will have to suffice.

Muxtape: Bringing Back The Art of The Mixtape

So I’ve just recently discovered Muxtape. It’s a site that allows you to make a little “mixtape” of songs by uploading and then choosing which order they go in. The interface is pretty easy to figure out. You click on a song (or just the area around the song) and it’ll play automatically. It was working pretty well last night but for some reason the thing is choking in Firefox for me right now (and making Safari crash AND making IE run out of memory), yay for compatibility testing!

Anyway, the site is neat because if you’re as old as I am, you might remember making mix tapes for your friends. There was an art to this. Instead of the crazy-huge capacities of an MP3 player that you have these days, tapes were limited to like, 90 minutes or something. And the order mattered too since tapes didn’t have skip functionality (unless you had a sweet-ass walkman with that feature built-in). Muxtape sort of forces a restriction on you by forcing you to choose only 12 songs, and by different artists (no dupes). Mix tapes were a labor of love and works of art! Muxtape is easier, but it also sorta reminds me of when I made mix tapes way back when.

So a few criticisms. First off, while Muxtape tries to keep it real by limiting you to the number of songs and artists, it’s still probably way illegal. I wonder why the site hasn’t been shut down yet. Not saying I’d like the site to be shut down, but the reality is that it’s totally un-legit. You might say it’s fine because it only lets you stream, but using Firebug, you can pretty easily tell what the address is for the MP3.

Also, lol at the constructed urls of the MP3s (the first get arg is “PLEASE=DO_NOT_STEAL_MUSIC”).

Last.fm also pretty much is THE place to go for finding new music, and they have tons of searchable (which you could argue is kind of important!) tracks available. Though I did try and recreate my mixtape on last.fm and two artists were missing (one is the IBM computer “singing” Daisy Bell) and of the 10 remaining songs, only 6 had the full tracks playable

So at least Muxtape wins as far as playability goes (though I did have to upload them myself)! There are probably some big legal issues that make it impossible for last.fm to do what Muxtape does. That’s probably good, since last.fm makes money for themselves and more importantly, artists, while Muxtape just makes money for themeselves (if you don’t count Amazon MP3 cuts going to artists). Last.fm makes artists money simply by streaming their music; no buying required.

Anyway, if you want to check out my own mix, go here. Hopefully it’s varied enough to be worthy of mixtape status. You must understand, I’m a bit rusty.

This is Probably Slightly Unhealthy…


It all started as a joke. A RickRoll. Following a link like “Starcraft 2 leaked trailer!” and instead being presented with a video of Rick Astley’s “Never Gonna Give You Up.”

But you have to admit. The song is pretty damn catchy. You know, with the whole peak of the chorus at “say goodbye!” The mp3 version of this song is much better quality than the youtube encoding.

Also, this past week something legendary happened. The first ever “real life” RickRoll via singing telegram. In the long term this kind of internet meme crossover is dangerous (imagine a real life Goatse.cx or a real life flash thing with the ghost popping out at you), but I approve of the creativity of the real life RickRoll.

Anyway, I should probably stop listening to this song. But I can’t. Like the title of the song states, I’m never gonna give it up… (never gonna give, never gonna give!)