Page 1 of 1

Weighting And Logic Used For Radio And Genre Featuers

PostPosted: Mon Feb 04, 2013 11:58 pm
by precipitous
Hakko: I am running version 7.21b and am very happy with it. With each version it just gets better and better. Thanks!!!!

I do have a question about the weighting and logic used for the radio and genre features, though: I have thousands of albums tagged with the genres Dark Ambient, Ambient, Experimental and Post-Punk. Yet if I select to play a MusicCabinet radio for one, or any combination of those genres most of the time a large number of the pieces that play are the same each time. Sometimes the tracks will be different ones, but from the same set of artists, and almost always from only one album by the artist. For a lot of the bands I own 10 or more of their albums, but all of the tracks that get selected are always from the same one album. Also, there a hundreds of artists within those genres who are never selected at all. I do not have this problem when playing random tracks from my collection as a whole. This makes me wonder if specific artists and albums/tracks are given a greater weight than others... If so, is there any way to equalize the weighting so one can get a truly random selection when playing music from specific genres only?

Thanks in advance for you help and insights.

Re: Weighting And Logic Used For Radio And Genre Featuers

PostPosted: Wed Feb 06, 2013 9:20 pm
by hakko
The artist radio and the genre radio are implemented as SQL select statements. They're found here: ...

Or, maybe easier to read:

It might not be super obvious, but the strategy is to create a list of (n) songs where an individual artist appears at most (m) times. Popular tracks by an artist are favored. Relevant artists are favored. (Based on genre relevance for genre radio, and based on artist similarity for artist radio.) Tracks are favored based on how many times you've listened to them (if this is configured to be imported from

The numbers n and m are configurable. Nothing else is configurable (but it could be).

The track ranking is currently random() * (110 - rank + (play_count/3)) where rank is global popularity (1-50) from and play_count is the number of times you've listened to a track. The artist ranking is currently random() * weight * weight where weight is genre relevancy resp artist similarity, for genre radio resp artist radio.
Higher means more likely to be picked.

There are some problems with this. For example are your local tracks matched against the top lists exactly (no name fuzziness), so if your tracks are misspelled, they will run a much lower chance of being picked in the radio system.

If you have a lot of artists with genre weight 100, an artist with genre weight 50 will run a very low chance of being picked.

A truly random selection can be achieved by modifying the code above. Or maybe through the advanced search? Or by configuring the genre radio playlist to be much larger (to include more artists into it)? You might also want to turn off the feature of having tracks that you've listened to a lot favored to make it more random.

But in general, the best way to make it fit your needs exactly is to mess with the code and change the algorithm for picking tracks. I just wrote something that I thought would fit me but there's no absolute truth here, everyone will have different ideas on how it should work.

Re: Weighting And Logic Used For Radio And Genre Featuers

PostPosted: Wed Feb 06, 2013 9:28 pm
by hakko
There is actually a much more random way of generating genre playlists, but it's only available through apps. When you specify random songs and a genre, there's no weighting involved of artists/tracks. It's handled here: ... .java#L544

Re: Weighting And Logic Used For Radio And Genre Featuers

PostPosted: Wed Feb 06, 2013 9:33 pm
by precipitous
@hakko: Thank you for this incredibly informative reply! It all makes a lot of sense and gives me the information necessary to both understand why certain tracks/artists/albums are almost always selected, and why others are not. I think I will try turning off the option to favor tracks I have listened to a lot, and also see where I get using the Advanced Search. If I end up editing any of the code (and come up with anything useful) I will pass it on to you...

Thank you again for all of the AMAZING work you have put into MusicCabinet. I regard it as one of the top 5 most useful applications that I could not imagine having to do without...

Re: Weighting And Logic Used For Radio And Genre Featuers

PostPosted: Wed Feb 06, 2013 10:06 pm
by hakko
Thanks for your feedback! It's really fun to hear that it comes in useful.

Re: Weighting And Logic Used For Radio And Genre Featuers

PostPosted: Fri Apr 05, 2013 11:42 pm
by wikke
at this late hour, I also want to chime in to say I love musiccabinet and I appreciate the many hours you have poured into this.
A year ago, I couldn't have imagined such a fantastic system existed.
I didn't like basic subsonic that much - this is the definitive version though !

I already discovered some new music which I otherwise would have missed.
The continuous updates make it worthwhile to read about the working of the program as well.. the faq is a good idea!