cmake build system: visiblity support for clang
[supercollider.git] / Help / UGens / Triggers / LeastChange.html
blobcfb7de597329def5635b4897f593dddf5f02cbb5
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; 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: 12.0px Helvetica; color: #0000ff}
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; color: #001bb9}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #ad140d}
17 span.s1 {font: 18.0px Helvetica}
18 span.s2 {color: #000000}
19 span.s3 {color: #0026b4}
20 span.s4 {color: #3d6d1d}
21 span.s5 {color: #001bb9}
22 span.Apple-tab-span {white-space:pre}
23 </style>
24 </head>
25 <body>
26 <p class="p1"><span class="s1"><b>LeastChange </b></span><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>output least changed</b></p>
27 <p class="p2"><br></p>
28 <p class="p3"><br></p>
29 <p class="p1"><b>LeastChange.ar(in1, in2)</b></p>
30 <p class="p1"><b>LeastChange.kr(in1, in2)</b></p>
31 <p class="p3"><br></p>
32 <p class="p1">output the input that changed least</p>
33 <p class="p3"><br></p>
34 <p class="p1"><b>in1, in2 </b>-<span class="Apple-converted-space">  </span>inputs</p>
35 <p class="p3"><br></p>
36 <p class="p4"><span class="s2">see also: <a href="MostChange.html">MostChange</a></span>, <a href="InRange.html">InRange</a></p>
37 <p class="p3"><br></p>
38 <p class="p3"><br></p>
39 <p class="p3"><br></p>
40 <p class="p5">(</p>
41 <p class="p5">d = { <span class="s3">arg</span> amp=1.0;</p>
42 <p class="p5"><span class="Apple-tab-span"> </span><span class="s3">var</span> in1, in2;</p>
43 <p class="p5"><span class="Apple-tab-span"> </span>in1 = <span class="s3">LFNoise0</span>.ar(800, amp);</p>
44 <p class="p5"><span class="Apple-tab-span"> </span>in2 = <span class="s3">SinOsc</span>.ar(800);</p>
45 <p class="p5"><span class="Apple-tab-span"> </span><span class="s3">LeastChange</span>.ar(in1, in2) * 0.1;</p>
46 <p class="p5">}.play;</p>
47 <p class="p5">)</p>
48 <p class="p3"><br></p>
49 <p class="p5">d.set(<span class="s4">\amp</span>, 0.1);</p>
50 <p class="p5">d.set(<span class="s4">\amp</span>, 0);</p>
51 <p class="p5">d.set(<span class="s4">\amp</span>, 3);</p>
52 <p class="p5">d.free;</p>
53 <p class="p2"><br></p>
54 <p class="p3"><br></p>
55 <p class="p1"><b>the control that changed least is used as output:</b></p>
56 <p class="p3"><br></p>
57 <p class="p2"><br></p>
58 <p class="p5">(</p>
59 <p class="p5">d = { <span class="s5">arg</span> freq=440;</p>
60 <p class="p5"><span class="Apple-tab-span"> </span><span class="s5">var</span> internalFreq;</p>
61 <p class="p5"><span class="Apple-tab-span"> </span>internalFreq = <span class="s5">LFNoise0</span>.ar(0.3, 300, 800);</p>
62 <p class="p6"><span class="s2"><span class="Apple-tab-span"> </span></span>SinOsc<span class="s2">.ar(</span></p>
63 <p class="p7"><span class="s2"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="s5">LeastChange</span><span class="s2">.kr(freq, internalFreq) </span>// two sources of change: one external, one internal</p>
64 <p class="p5"><span class="Apple-tab-span"> </span>) * 0.1</p>
65 <p class="p5">}.play</p>
66 <p class="p5">);</p>
67 <p class="p2"><br></p>
68 <p class="p5">d.set(<span class="s4">\freq</span>, 800);</p>
69 <p class="p5">d.set(<span class="s4">\freq</span>, 900);</p>
70 <p class="p5">d.free;</p>
71 <p class="p3"><br></p>
72 <p class="p3"><br></p>
73 </body>
74 </html>