1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
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 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #9d1c12}
18 span
.s1
{font: 18.0px Helvetica
}
19 span
.s2
{color: #000000}
20 span
.s3
{color: #0026b4}
21 span
.s4
{color: #3d6d1d}
22 span
.s5
{color: #001bb9}
23 span
.Apple-tab-span
{white-space:pre
}
27 <p class=
"p1"><span class=
"s1"><b>MostChange
</b></span><b><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span>output most changed
</b></p>
28 <p class=
"p2"><br></p>
29 <p class=
"p3"><br></p>
30 <p class=
"p1"><b>MostChange.ar(in1, in2)
</b></p>
31 <p class=
"p1"><b>MostChange.kr(in1, in2)
</b></p>
32 <p class=
"p3"><br></p>
33 <p class=
"p1">output the input that changed most
</p>
34 <p class=
"p3"><br></p>
35 <p class=
"p1"><b>in1, in2
</b>-
<span class=
"Apple-converted-space"> </span>inputs
</p>
36 <p class=
"p3"><br></p>
37 <p class=
"p3"><br></p>
38 <p class=
"p4"><span class=
"s2">see also:
<a href=
"LeastChange.html">LeastChange
</a>,
<a href=
"InRange.html">InRange
</a></span></p>
39 <p class=
"p3"><br></p>
40 <p class=
"p3"><br></p>
41 <p class=
"p3"><br></p>
43 <p class=
"p5">d = {
<span class=
"s3">arg
</span> amp=
1.0;
</p>
44 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"s3">var
</span> in1, in2;
</p>
45 <p class=
"p5"><span class=
"Apple-tab-span"> </span>in1 =
<span class=
"s3">LFNoise1
</span>.ar(
800, amp);
</p>
46 <p class=
"p5"><span class=
"Apple-tab-span"> </span>in2 =
<span class=
"s3">SinOsc
</span>.ar(
800);
</p>
47 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"s3">MostChange
</span>.ar(in1, in2) *
0.1;
</p>
48 <p class=
"p5">}.play;
</p>
50 <p class=
"p3"><br></p>
51 <p class=
"p5">d.set(
<span class=
"s4">\amp
</span>,
0.1);
</p>
52 <p class=
"p5">d.set(
<span class=
"s4">\amp
</span>,
0);
</p>
53 <p class=
"p5">d.set(
<span class=
"s4">\amp
</span>,
3);
</p>
54 <p class=
"p5">d.free;
</p>
55 <p class=
"p2"><br></p>
56 <p class=
"p3"><br></p>
57 <p class=
"p1"><b>the control that changed most is used as output:
</b></p>
58 <p class=
"p3"><br></p>
59 <p class=
"p2"><br></p>
61 <p class=
"p5">d = {
<span class=
"s5">arg
</span> freq=
440;
</p>
62 <p class=
"p5"><span class=
"Apple-tab-span"> </span><span class=
"s5">var
</span> internalFreq;
</p>
63 <p class=
"p5"><span class=
"Apple-tab-span"> </span>internalFreq =
<span class=
"s5">LFNoise0
</span>.ar(
0.3,
300,
800);
</p>
64 <p class=
"p6"><span class=
"s2"><span class=
"Apple-tab-span"> </span></span>SinOsc
<span class=
"s2">.ar(
</span></p>
65 <p class=
"p7"><span class=
"s2"><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></span><span class=
"s5">MostChange
</span><span class=
"s2">.kr(freq, internalFreq)
</span>// two sources of change: one external, one internal
</p>
66 <p class=
"p5"><span class=
"Apple-tab-span"> </span>) *
0.1</p>
67 <p class=
"p5">}.play
</p>
69 <p class=
"p2"><br></p>
70 <p class=
"p5">d.set(
<span class=
"s4">\freq
</span>,
800);
</p>
71 <p class=
"p8"><span class=
"s2">d.set(
</span><span class=
"s4">\freq
</span><span class=
"s2">,
800);
</span>// nothing changed in this input
</p>
72 <p class=
"p5">d.set(
<span class=
"s4">\freq
</span>,
900);
</p>
73 <p class=
"p5">d.free;
</p>
74 <p class=
"p3"><br></p>
75 <p class=
"p3"><br></p>