class library: SynthDef - lazy implementation of removeUGen
[supercollider.git] / HelpSource / Classes / Dwrand.schelp
blobf4d4db42f35a8e836a5ec6263b06a7a655e31ba6
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:: length
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;