posted by Manuel Amador on Wed 14th Jul 2004 18:54 UTC
"Shuffling, Page 2/3"
A mathematical foundation for the solution: network theory

Our neural network stores a song relationship network, which is intertwined with a set of playlists and preferences. Modern day players (such as Rhythmbox) already give you a way to rate songs, so preferences are mostly covered. By the way, I wish for two things in that field: Rhythmbox should build a less unobtrusive way to rate songs, and it should automatically calculate (both overall and seasonal) preferences based on what I have chosen to listen.

Song relationship networks have been explored less. There are projects which seek to mine personal networks for benefit. Audioscrobbler and AudioGalaxy have collected massive information on listeners' preferences, and can successfully tell you that if you liked Vanessa Amorosi, you're probably going to like Ace of Base. But they cannot find out whether it is “right” to listen to Ravine from Ace of Base after Beautiful life. Only you can.

What I'm proposing here is that Rhythmbox (or any other music player) should remember “what I've heard next” and use that as a reference/suggestion to choose songs in Mood mode (a Shuffle mode on steroids). All you would need to do is turn Mood on, and every once in a while hit Next until the player learns enough.

This sounds extremely difficult to implement, but it is probably easier than it seems to.

Network theory applied to music

Say you have 28 songs (A to Z) you generally like to listen to. When in a romantic mood, you like to listen to A through E, while in an uptempo mood you usually to listen to W to Z. This means A, B, C, D and E are related to each other. The same applies to W, X, Y and Z.

Relationships between songs matter just as much as personal taste. Probably Z sounds just about right after W, or X, but it may not be “wanted” after A, E or F.

It follows that the number of times you've heard Z after W is higher than you've heard it after A. Z is more strongly related to W than to A. In practical terms, the mutual relationship between W and Z goes up if you choose Z or let Z play when it comes up after W.

Songs don't form isolated groups, though. Maybe song Q sounds great after Z and after A as well (Q has a high relationship between Z and A). Song Q forms a bridge between the two islands A-E and W-Z (this allows for smooth drifts of mood).

Mathematically speaking, the probability that Z gets queued up after W is the number of times Z played after W, divided by the the number of times songs played after W.

This system is simple. Mood mode should choose the next song to play, among a list of candidates that historically played after the current song, then assign probabilities to each candidate using a probability distribution calculated from the relationship strengths between the current and the candidate songs. If Z played 250 times after W, and X played 125 times after W, then Z has double the chance of X being queued up after W.

P(Z|W) = N(Z|W) / Sum of N(any,W)

The clash with reality: how to make this system work fine

However, this system, if implemented as explained, would not be useful (are you surprised?). You'd need to manually select songs until the computer has learned, or use Shuffle to teach the computer. For ten thousand songs, that is just not practical. It would take ages to seed the database with enough relationships for it to be useful and start “digging your tastes and moods".

It is also not robust. What would happen if you were listening to a song for two minutes, and decide to change it to another song appropriate for the current mood? Should this event be tallied up as making the relationship stronger, or weaker?

Thus, I propose several incremental improvements for Mood mode.

Use two-way (mutual) instead of one-way (directional) relationships between songs

Whether you have heard W after Z, but not Z after W, should not matter. W and Z should still be related. That means everytime you choose Z (or let Z play) after W, the relationship should grow stronger between both Z and W.

Remember what has played in the current session

Songs that already played before should not be queued up again. This cancels out a flaw introduced by 1.

Table of contents
  1. "Shuffling, Page 1/3"
  2. "Shuffling, Page 2/3"
  3. "Shuffling, Page 3/3"
e p (0)    36 Comment(s)

Related Articles

posted by Eugenia Loli-Queru on Wed 17th Sep 2008 23:09
posted by Thom Holwerda on Thu 21st Aug 2008 16:16, submitted by jcornuz
posted by Eugenia Loli-Queru on Tue 22nd Jul 2008 08:29