sclang: ServerShmInterface - try to avoid multiple destructor calls
[supercollider.git] / HelpSource / Classes / TChoose.schelp
blob196b193170d6732a75826a32c9332b892774515a
1 class:: TChoose
2 summary:: Randomly select one of several inputs
3 categories:: UGens>Triggers, UGens>Random
4 related:: Classes/TWChoose
6 description::
7 An output is selected randomly on recieving a trigger from an array of inputs.
9 TChoose returns a combination of link::Classes/Select:: and link::Classes/TIRand::.
11 classmethods::
12 method:: ar, kr
14 argument:: trig
15 argument:: array
17 examples::
18 code::
21         var a;
22         a = [
23                         SinOsc.ar,
24                         Saw.ar,
25                         Pulse.ar
26                 ];
27         TChoose.ar(Dust.ar(MouseX.kr(1, 1000, 1)), a) * 0.2
29 }.play;
33 note:: all the ugens are continously running. This may not be the most efficient way if each input is  cpu-expensive.