An alternative client for iRATE written in Perl/Tk

I really like the iRATE program and the whole idea of collaborative filtering, but I really don't like iRATE's track selection algorithm.  Since it would have been a lot of work for me to get up to speed on java client coding just to implement a change which no one else seemed to think was important, I went my own way and wrote this code in Perl/Tk.

AlterniRATE doesn't download files; it assumes that you'll use the official iRATE client every once in a while to get files.  (I plan to make AlterniRATE a full client eventually, but that will take time!) I also haven't worried about what would happen if you had a very small number of files; you probably ought to have a couple dozen downloaded before you try AlterniRATE.

AlterniRATE uses XMMS to play files, so it's limited to platforms such as GNU/Linux where XMMS runs.  (It should be possible to fix the code to use Winamp::Control on Windows, but I don't know when (or if) I'll work on that.)

AlterniRATE requires these perl modules:
Debian users can
apt-get install perl-tk libtk-tablematrix-perl libmp3-info-perl libxml-simple-perl libxmms-perl
and be all set.

The heart of AlterniRATE is the track selection algorithm.  This dialog box (under Settings -> Track Selection ...) hopefully explains it:

Each time a track is played, the probability weighting of the played track is set to 1 and the weighting for every other track is multiplied by a factor which depends on its rating.  Because the weight increases exponentially for files that remain unplayed, all your old tracks will eventually get played again. (The official iRATE client seems to just forget about your lower-rated older tracks and you'll never ever hear them again.)

The AlterniRATE client's main window is designed after the official client: here's a screenshot.

This code comes with NO WARRANTY, and while I'm really careful about it, it does overwrite the official trackdatabase.xml file when AlterniRATE quits.  (It backs up the file in trackdatabase.xml_AlterniRATE_backup on startup; if trackdatabase.xml is newer than this backup file it won't overwrite, leaving its update in trackdatabase.xml_AlterniRATE_new instead.)

Although things are basically working, this release is geared towards people who at least know how to install their own Perl modules and that sort of stuff.

2003/12/03 - version 0.2 :
  • Fixed the bug which caused AlterniRATE to occasionally go through a bunch of tracks without playing them. (Increased the time for the initial callback to check and see if xxms is playing.)
  • Adjusted the defaults based on my experience playing AlterniRATE.

2003/12/19 - version 0.3 :
  • fixed the "xmms playlist window pops up" problem for sure this time. (added a delay between setting the playlist and playing)
  • clean up AlterniRATE.xml after having downloaded/deleted tracks with the official client
  • delete zero-rated tracks on exit
Here's the code.