Noatun Playlists - Better random song selection

Brendon Higgins bh_doc at users.sourceforge.net
Sat Apr 26 07:38:12 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Noatun kicks arse. I usually just turn it on, stick it on random over my whole
collection, and let it rock away. Though I've noticed that the way songs are
selected at random during play is a little, well, too random. I, and I assume
most people, would like it to work similarly to the shuffle op in the
playlist, but without actually shuffling anything, and still being random
with songs that have been played a while ago - like repeatedly shuffling the
tail-end of the list, so to speak.

Currently, the way the next song is selected is completely random with every
song having the same probability of being selected, thought this is not a
very "natural" way of doing this. The natural way would be for a song to be
selected based on things like how long it's been since it was played before,
relative to the other songs. It should be the case that after a while the
number of times each song has been played should all be roughly the same.

It came to me the way to do this would be to have weightings associated with
each song, and have those weightings proportional to how recently the song
was played previously, or how many times the song has been played relative to
the average of all songs. So I wrote a program to analyse some statistics of
such methods (code attached; there is minimal commenting - if something isn't
obvious just mail me), the most important statistic being the number of steps
between each play of each individual song. This should be reasonably
constant, ie. have a low standard deviation for each song, and thus a low
average of all SDs for each song.

The best way I've found is the method in SimpleWeightedShuffler (the third
complete Shuffler type) which at first spreads weightings evenly over all the
songs, and for each song that gets picked its individual weighting is added
evenly to all the others, and then is set to 0. This way a song will never be
picked twice in a row, and if a song hasn't been played in a while it becomes
more and more likely that it will be played. The current method does not
guarantee this, and I'm always feeling that there are a few songs I haven't
heard in ages while there are others that Noatun seems to want to play
ad-nauseum.

I'm not sure if this is an area that anyone is interested in. It may be that
this method is too bulky for some people, though it'd be fine for my
purposes. I've had a short look at the split playlist source, but I decided
I'd better let the pros handle it, first. I'm not likely to make a playlist
plugin from this, but if anyone else would like to, great!

BTW, I'm not subscribed to the list, so CCs would be appreciated.

Peace,
Brendon Higgins

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+qilUCTfPD0Uw3q8RAnciAKCRtlhu66Vk8eiYzItHfdTSgkxiXACgvu4O
S9CR3Kuil52w8l9QHiFB4AM=
=5QJM
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plshuffler.cpp
Type: text/x-c++src
Size: 6841 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20030426/0e9cc3a7/attachment.cpp>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list