bongo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bongo-devel] Random track selection


From: Anthony Chaumas-Pellet
Subject: [bongo-devel] Random track selection
Date: Sat, 17 Mar 2007 18:42:49 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (berkeley-unix)

Hello,

While using Bongo in random-playback-mode, I've noticed some tracks
were virtually never played. So, I would suggest a small fix to make
the random selection more equal.

It appears 'bongo-point-at-random-line-satisfying' uses goto-char to
select the next track, so the random pick will tend to favour longer
track names. Is there a practical reason for this choice?

I've been using a random selection based on lines instead, with
results closer to the expected distribution. I'm not sure how to send
the patch, though, as the Darcs format has a very bad noise-to-signal
ratio here. I'll err on the side of caution and inline the relevant
changes.

hunk ./bongo.el 2239
-    (while (progn (goto-char (+ (point-min)
-                                (random (- (point-max)
-                                           (point-min)))))
+    (while (progn (goto-line (+ (point-min)
+                                (random (count-lines (point-min) 
(point-max)))))


Thanks,
Anthony Chaumas-Pellet




reply via email to

[Prev in Thread] Current Thread [Next in Thread]