Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / HelpSource / Classes / Dwrand.schelp
blobcc83726143e9a12c242c6dee511697644298a993
1 class:: Dwrand
2 summary:: Demand rate weighted random sequence generator
3 categories:: UGens>Demand, UGens>Random
4 related:: Classes/Demand
6 classmethods::
7 method:: new
8 argument:: list
9 array of values or other ugens
10 argument:: weights
11 array of values (should sum up to 1.0)
12 argument:: repeats
13 number of values to return
14 discussion::
15 structurally related: link::Classes/Pwrand::, link::Classes/TWindex::, link::Classes/TWChoose::
17 examples::
18 code::
21         var a, freq, trig;
22         a = Dwrand([0, 1, 2, 7], [0.4, 0.4, 0.1, 0.1], inf).dpoll;
23         trig = Impulse.kr(MouseX.kr(1, 400, 1));
24         freq = Demand.kr(trig, 0, a) * 30 + 340;
25         SinOsc.ar(freq) * 0.1
27 }.play;