linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / LeastChange.schelp
blob88e01d62e033a81ef42af19fd22f409d582452eb
1 class:: LeastChange
2 summary:: Output least changed
3 related:: Classes/MostChange, Classes/LastValue
4 categories::  UGens>Maths
7 Description::
9 Output the input that changed least.
12 classmethods::
14 method::ar, kr
16 argument::a
18 Input signal A.
21 argument::b
23 Input signal B.
25 examples::
27 code::
29 d = { arg amp=1.0;
30         var in1, in2;
31         in1 = LFNoise0.ar(800, amp);
32         in2 = SinOsc.ar(800);
33         LeastChange.ar(in1, in2) * 0.1;
34 }.play;
37 d.set(\amp, 0.1);
38 d.set(\amp, 0);
39 d.set(\amp, 3);
40 d.free;
43 the control that changed least is used as output:
45 code::
47 d = { arg freq=440;
48         var internalFreq;
49         internalFreq = LFNoise0.ar(0.3, 300, 800);
50         SinOsc.ar(
51                 LeastChange.kr(freq, internalFreq) // two sources of change: one external, one internal
52         ) * 0.1
53 }.play
56 d.set(\freq, 800);
57 d.set(\freq, 900);
58 d.free;