Randomizing Methods
for getting smooth random distributions, try extRand.sc.
These methods are not fully statistically tested, but I hope they are accurate.
nrand:
nrand creates a linear probability envelope over the values (nodes).
use like
x = [0, 0, 0.3, 1, 0.2, 0, 0];//values (x-axis)
y = [1, 1, 1, 2.5, 0.2, 1];//weights (y-axis)
x.nrand(y)
or: nrand(x,y)
frand:
frand uses a function as a probabilty envelope.
use like
{ arg x; sin(x) }.frand(0, pi/2, 0, 1)
an extension for Chad Kirby's SeedyRand: extSeedyRand.sc
{ arg x; sin(x) }.frand.postln;
0.334556
0.20253
0.987335
0.992417
0.767358
0.917958
0.850005
0.417776
0.744946
0.690959
0.247141
0.732695
0.9319
0.931571
0.590735
0.510067
0.927944
0.90651
0.878975
0.891195
0.699155
0.847736
Links to this Page
- Public Library 3 last edited on 27 October 2006 at 9:41 pm by host81-159-217-15.range81-159.btcentralplus.com
- enter. last edited on 29 January 2003 at 10:46 pm by 203.14.169.19
- Public Library SC2 last edited on 2 March 2005 at 2:20 pm by max2-223.dialin.uni-hamburg.de