Noatun Playlists - Better random song selection

Eray Ozkural exa at kablonet.com.tr
Sat Apr 26 19:01:07 BST 2003


On Saturday 26 April 2003 09:38, Brendon Higgins wrote:
> 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.

Your claim strikes me as being completely wrong! That is of course the most 
natural way *if* the random shuffle algorithm works correctly, which is

   for i=n to 2
      k <- a random integer between 1 and n-1
      swap A[i] and A[k]

If the random function is "sufficiently random" this will indeed produce a 
very natural shuffling of a list with uniform distribution. Any deficiency in 
the resulting ordering must be attributed to the pseudo random function being 
used. Last time we discussed this, we decided the random device in the kernel 
should be used when possible. Pseudo random number generator in C library is 
obviously not good enough as can be easily seen while using XMMS or Noatun.

However, not all playlists can afford that. See for instance my playlist dub 
which has a less expensive way of handling the same problem since it is 
designed for playlists with >5000 files spread over many directories.

Thanks,

-- 
Eray Ozkural (exa) <erayo at cs.bilkent.edu.tr>
Comp. Sci. Dept., Bilkent University, Ankara  KDE Project: http://www.kde.org
www: http://www.cs.bilkent.edu.tr/~erayo  Malfunction: http://mp3.com/ariza
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C



More information about the kde-multimedia mailing list