The problem
I like listening to music while I’m programming. However, I have lots of music on my computer and I don’t really like all of it (or find it appropriate as background music for when I’m programming).
I guess I could spend a few evenings going through my music collection, deleting anything I don’t like (which isn’t always such an easy decision), creating a playlist or whatever. This isn’t a permanent solution, though, since with the time my collection will continue growing, I may get sick of hearing some songs, my taste may change, etc. Also, I prefer spending my time programming, reading or doing anything else more interesting than sorting my music collection.
Unrelated to the problem itself, let me also mention that I use different media players. Currently I’m mostly using Banshee, but I’ve been intermittently toggling between it and Rhythmbox those last months, and also used a command-line player for some time. I’m saying this because I expect a optimal solution to be media player-independent. The bigger problem of each media player having its own database is also something I’d like to see addressed, maybe with some technology like Tracker, but that is another topic.
The status quo
My current way to approach this problem is basically setting my media player to choose songs randomly, and using the big “Next >>|” button on my keyboard whenever it chooses some song which annoys me.
(Banshee’s playback list interface has an option to automatically fill itself sorting songs by popularity, but it doesn’t seem to work good at all here; I also recall Amarok having some automatic playlist generation options, but I’m not using any KDE applications anymore and in any case this is outside the scope of an application-neutral solution).
The solution
It has recently occurred to me that a neat solution for this would be to gather information from a generic event log and to translate that into a numerical punctuation for each song. I think you may already guess where I’m heading, but if not: Zeitgeist!
With the appropriate data-sources installed, Zeitgeist holds information on which songs started playing automatically (because they are on a playlist or because you have your media player set to random), which were started manually, and in both cases which you listened to completely and which ones you skipped (and how long you resisted listening to them). It shouldn’t be too difficult to write a script which will periodically request this information from Zeitgeist and give songs positive points for every time you listened to them completely (extra if you chose them yourself manually) and negative points to the ones you skipped (but giving less negative points if you resisted half of the song than if you skipped it right after you recognized it).
With this punctuation information, music players can avoid playing songs you don’t like and give you only those you like or new ones for which there isn’t any information yet (if it followed the punctuation strictly this would end with the same songs being played all the time and new songs with punctuation around 0 being ignored). The importance of the play/skip actions would decay over time (it’s more important to consider whether you listened to the song yesterday than if you did six months ago), etc., etc.
If we wanted to create something really fancy we could even look at generating different ratings for separate circumstances, eg. in case you like listening to a different sort of music during the morning than during the evening, or to differentiate between what you like to hear while you are coding and while the computer is idle (maybe because you are doing paper homework and only using the computer to get some background music). The information for all this is there in Zeitgeist, so it’s only a matter of writing a good algorithm.
The implementation
I’ve already explained most of how this should work in the previous section, but here’s a bit of an overview of what’s needed for this:
- Data-sources inserting the music reproduction information. We already have a data-source for Rhythmbox implemented as an extension, but Banshee and any other players are missing.
- The actual algorithm, probably implemented as a periodically run script leaving the aggregated information at some accessible place, although this may vary depending on the degree of fanciness you choose.
- The interface, ie. plugins for Rhythmbox and other media players which take that information and use it to provide an option for semi-randomly choosing music excluding stuff you don’t like.
If I’ve got you interested on this, I’m willing to mentor someone on this, so get in touch! Feel free to jump into #zeitgeist on irc.freenode.net or drop me a mail.







Something that occurs to me is I have trouble rating things in a general sense. I rate things within a certain context. For example, a particular track may be an awesome fit within my “Thinking music” soundtrack, but terrible in other contexts.
Anyway, just throwing that out there. Sounds like a good approach you have :)
I could have sworn there was an automatic rating extension being worked on for Banshee, but I haven’t seen it.
Good luck to anyone who takes it on!
Wow that sounds terrific! ;)
QuodLibet has a plugin that does this, except I don’t think ratings decrease over time if you don’t listen to a particular track.
And QL’s search functionality is completely awesome!
Sounds like a great idea :-)
I know this is not what you are lloking for but… I’ve been trough the same issues with lot of music and my final solution is Premium Lastfm.
I don’t hear it everyday but the “love/ban song” is the ultimate sorting interface for me.
You can do much of it already with gmusicbrowser per weighted randoms and other filters. It’s one of the most flexible and functional (local-)audio-library/player programs out there.
Too bad it doesn’t receive as much attention.
Some more info on it: http://gmusicbrowser.org/
THIS! I’ve seriously been looking for this particular funcionality for a very long time, glad to know I’m not the only one.
Are you asking for something different than Banshee’s ability to auto-score songs, from 0 to 100, based on whether you play or skip them? It was first released in Banshee 1.5.0 almost a year ago. You can add it as a column and sort by it, or add it as a condition in a smart playlist (or search), or you can Shuffle by Score (or Auto DJ by score) which will prefer your higher-scored songs.
Banshee got an automatic rating feature in 1.6. See http://banshee-project.org/download/archives/1.6.0/
The newest Banshee can shuffle by rating and by score. (Rating is done by hand by giving “stars” to a song, so that’s not what you want.)
Scoring is done automatically, depending on how much of the song you listen to before you skip it and the score it had before. You can show the score column in the track list to see what score a song currently has.
So maybe that’s already what you want. But of course you need to use it some time to “train” the scores.
# The actual algorithm, probably implemented as a periodically run script leaving the aggregated information at some accessible place, although this may vary depending on the degree of fanciness you choose.
The output should/can be a property in tracker “zg:music-score” or something like that.
BTW i think that algorithms as plugins in ZG, “publishing” the aggregate values “somewhere” (e.g. Tracker) is the way to go.
# The interface, ie. plugins for Rhythmbox and other media players which take that information and use it to provide an option for semi-randomly choosing music excluding stuff you don’t like.
That could be part of the Applications/Tracker integration. The Tracker plugin in Rhythmbox can offer playlist like “recently played”, “by playcount” or… “by zeitgeist relevance”!
Does the rhythmbox plugin which feeds data into zeitgeist have a deb package? I could not find any on http://launchpad.net/zeitgeist-dataproviders
@ Dylan McCall:
Absolutely. Different scores for different circumstances (eg. some sort of music for when you’re working on a particular project, another one for when you’re idle, etc.) is something which Zeitgeist could handle up to a certain degree; it would be interesting to experiment with this.
@ Zash, Tuxdragon:
Thanks for recommending those, I may try them out when I’ve got a moment.
@ Arpia49:
While that sort of love/hate rating isn’t that bad (compared to having you choose a numerical value), it’s something I’ve avoided in my proposal as I want the rating to be fully autonomous. Also I’m not really comfortable with streaming solutions with my current 1 Mbps connection (shared between 4 computers). I’m happy that it works for you though :).
@ Gabriel Burt, Paul, Robin:
Thanks for letting me know about this, I’m updating to 1.6 now and will try it out, I may well work enough for me.
However the main reason why I wrote this post was to plug Zeitgeist, which has some advantages:
– Media-player independent; you can switch to another media player at any time and the information will still be there (without needing any export/import process).
– Full, situated information so you can have several classifications (see my answer to Dylan McCall), do stuff like finding out which songs you usually listen to together when you are choosing them manually, etc.
– Another consequence of the previous point is that the score can be recalculated from scratch if the algorithm is improved, given that all data is there.
– I think I thought of some more benefits of using Zeitgeist for this but I’ve forgotten them by now :P.
@ Ivan Frade:
Hey! Indeed, saving the score in Tracker would probably make sense; I didn’t mention it because Rhythmbox/Banshee aren’t using Tracker at the moment and depending on it just to store a number would be overkill, but I’d love to see those and other applications storing all their data in Tracker (I even briefly mentioned this in my post).
Using Tracker for this would also have a benefit, which is that the algorithm can ask it for the duration of the songs (so that it won’t penalize a song if it’s skipped 10 seconds before it finishes, for example).
However there is one concern I have with Tracker, which is its rigid structure. In many cases there will probably be more than one method for calculating something, for example in this case having a single “music-score” value can be rather limiting. It also doesn’t work with more fancy cases like having different scores for songs you want to hear at the morning / at the night / when you’re coding / when you’re learning / etc.
@ Abhishek Dasgupta:
No, the data-sources aren’t packaged yet. However you can install the Rhythmbox plugin like this:
$ bzr get lp:zeitgeist-dataproviders
$ cd zeitgeist-dataproviders/rhythmbox/
$ sh install.sh
(You may need to enable it manually in Rhythmbox’s preferences dialogue).
Thanks for your comments, everyone! :)
@RainCT: The thing I find very interesting is that you don’t have to rate ALL your library, just what you loved or what you hate. If you have weeks of music stored it’s very difficult to give a fair score to all of them, I’m sure that you’re going to change your mood and a song that one day seems an 8, other day could be a 6, in fact youtube and other 2.0 webs have use now as default score system “like/dislike”.
At first I was trying to look for the ultimate music organizer, but suddenly I realized that I want to program with music, but keep focus on the programing thing not into the music. I’m not trying to send you a lastfm account, just the idea under it ;)
Btw I just remembered the ID3 tag spec has a field for song ratings if I’m not mistaken. Zeitgeist and Tracker are great and all but when you have a way to store such info in the file allowing it to easily be available in several devices (be it computers, portable media players, etc) I think it should be used. :)
@Dextro the idea is good, but the complexity is huge: ID3 works for Mp3, but not for OGG or any other format, so you start to have a big combination of formats/metadata.
[...] I read this post and felt really inspired. It got me thinking about what music players of the next generation could [...]
Have you considered using MPRIS as a media-player-independent interface? this way we can just write an MPRIS app (or daemon) and get every player interface with it through dbus.
AFAIK most of the biggest media player support MPRIS, so it would be easy to adopt your code.
Something like an online database of songs ratings which can be integrated with our own player and media library would be great i have about 8000 songs in my media library and to rate each song manually would be pain in the — but the shuffle feature of all player pics one good song for 5 pics rating would be better