View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

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