[PD] Weighted Randomness

Frank Barknecht fbar at footils.org
Sat Oct 13 11:42:21 CEST 2007

B. Bogart hat gesagt: // B. Bogart wrote:

> Does someone have a very simple implementation of a weighted randomness
> patch where the distribution of the numbers is read from a table? I see
> Miller's moses example, but I would like more graphic control of density.

Not graphical, but [list]-abs has [list-wrandom] (also attached). It'd
modelled after [random], but instead of the range, you send a list of
numbers to the second inlet, that give relative probabilities for its
indices/positions. If you bang the first inlet to get a random
position out. The probs are automatically normalized. I don't think
it's in pd-extended yet, but it's just an abstraction, so you can drop
it in wherever you want (uses some other list-abs, though.)

Internally the list of probs is stored in a table, so if you rip it
apart, you can directly read from a table.

 Frank Barknecht                                     _ ______footils.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: list-wrandom-help.pd
Type: application/puredata
Size: 3693 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20071013/198a58e0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: list-wrandom.pd
Type: application/puredata
Size: 1834 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20071013/198a58e0/attachment-0001.bin>

More information about the Pd-list mailing list