cmake build system: visiblity support for clang
[supercollider.git] / Help / UGens / Triggers / TWChoose.html
blobb60278d496f99d506d00450e023725bf71a4ab8d
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.35">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #0037ad; min-height: 12.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #0037ad}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
16 span.s1 {font: 18.0px Helvetica}
17 span.s2 {color: #0038f8}
18 span.s3 {color: #0037ad}
19 span.Apple-tab-span {white-space:pre}
20 </style>
21 </head>
22 <body>
23 <p class="p1"><span class="s1"><b>TWChoose<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span><b>randomly select one of several inputs</b></p>
24 <p class="p2"><br></p>
25 <p class="p3"><br></p>
26 <p class="p1">An output is selected randomly on recieving a trigger from an array of inputs.</p>
27 <p class="p1">the <b>weights</b> of this choice are determined from the weights array.</p>
28 <p class="p1">If <b>normalize</b> is set to 1 the weights are continuously normalized (this is an extra overhead)</p>
29 <p class="p1"><span class="Apple-tab-span"> </span>when using fixed values the <b>normalizeSum</b> method can be used to normalize the values</p>
30 <p class="p3"><br></p>
31 <p class="p1">superclass: Object (TWChoose is a composite of <a href="TWindex.html"><span class="s2">TWindex</span></a> and <a href="../Multichannel/Select.html"><span class="s2">Select</span></a><span class="s2"> )</span></p>
32 <p class="p2"><br></p>
33 <p class="p2"><br></p>
34 <p class="p1"><b><span class="Apple-tab-span"> </span>*ar(trig,array,weights,normalize)</b></p>
35 <p class="p1"><b><span class="Apple-tab-span"> </span>*kr(trig,array,weights,normalize)</b></p>
36 <p class="p2"><br></p>
37 <p class="p2"><br></p>
38 <p class="p2"><br></p>
39 <p class="p4">(</p>
40 <p class="p5">{<span class="Apple-converted-space"> </span></p>
41 <p class="p5"><span class="Apple-tab-span"> </span><span class="s3">var</span> a;</p>
42 <p class="p5"><span class="Apple-tab-span"> </span>a = [</p>
43 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s3">SinOsc</span>.ar,</p>
44 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s3">Saw</span>.ar,</p>
45 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s3">Pulse</span>.ar</p>
46 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>];</p>
47 <p class="p5"><span class="Apple-tab-span"> </span><span class="s3">TWChoose</span>.ar(<span class="s3">Dust.ar(MouseX.kr(1, 1000, 1))</span>, a, [0.99, 0.05, 0.05].normalizeSum) * 0.2</p>
48 <p class="p6"><span class="Apple-tab-span"> </span></p>
49 <p class="p5">}.play;</p>
50 <p class="p4">)</p>
51 <p class="p2"><span class="Apple-tab-span"> </span></p>
52 <p class="p1">Note: all the ugens are continously running. This may not be the most efficient way if each input is<span class="Apple-converted-space">  </span>cpu-expensive.</p>
53 </body>
54 </html>