[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bongo-devel] Random track selection
From: |
Daniel Brockman |
Subject: |
Re: [bongo-devel] Random track selection |
Date: |
Sat, 17 Mar 2007 21:33:11 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) |
Hi Anthony,
> 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?
No, there is no reason for this. Good catch!
> 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.
Yes, the Darcs format is not well-suited to posting
suggested patches for discussion on a mailing list.
But `darcs diff -u' will produce a regular patch.
> 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, I installed this.
--
Daniel Brockman <address@hidden>