2 summary:: Demand results from demand rate UGens.
3 related:: Classes/Demand, Classes/TDuty
4 categories:: UGens>Demand
9 A value is demanded each UGen in the list and output according to a
10 stream of duration values. The unit generators in the list should be
14 When there is a trigger at the reset input, the demand rate UGens in the
15 list and the duration are reset. The reset input may also be a demand
16 UGen, providing a stream of reset times.
25 Time values. Can be a demand UGen or any signal. The next level
26 is acquired after duration.
31 Trigger or reset time values. Resets the list of UGens and the
32 duration UGen when triggered. The reset input may also be a
33 demand UGen, providing a stream of reset times.
38 Demand UGen providing the output values.
43 A doneAction that is evaluated when the duration stream ends. See
45 link::Reference/UGen-doneActions:: for more detail.
54 Drand([0.01, 0.2, 0.4], inf), // demand ugen as durations
56 Dseq([204, 400, 201, 502, 300, 200], inf)
58 SinOsc.ar(freq * [1, 1.01]) * 0.1
67 MouseX.kr(0.001, 2, 1), // control rate ugen as durations
69 Dseq([204, 400, 201, 502, 300, 200], inf)
71 SinOsc.ar(freq * [1, 1.01]) * 0.1
77 Resetting the demand ugens:
83 Dseq([0.2, 0.3, 0.4, Dseq([1, 1, 1, 2, 1, 2], inf)]) / 2,
84 Dust.kr(1), // control rate reset
85 Dseq([0, 1, 2, Dseq([1, 2, 3, 4, 5], inf)])
87 SinOsc.ar(freq * [1, 1.01]) * 0.1
96 Dseq([0.2, 0.3, 0.4, Dseq([1, 1, 1, 2, 1, 2], inf)]) / 2,
97 Dseq([1, 2, 4, 5], inf), // demand rate reset
98 Dseq([0, 1, 2, Dseq([1, 2, 3, 4, 5], inf)])
100 SinOsc.ar(freq * [1, 1.01]) * 0.1
106 Demand ugen as audio oscillator:
113 x = { 0.2.rand2 } ! m;
114 x = x ++ ({ Drand({ 0.2.rand2 } ! n) } ! m.rand);
115 Dseq(x.scramble, inf)
118 MouseX.kr(1, 125, 1) * SampleDur.ir * [1, 1.02],
120 Dswitch1(a, MouseY.kr(0, n-1))
127 single sample feedback: a lin cong algorithm:
130 b = Buffer.alloc(s, 1);
132 var x, y, rate, a, c, m;
133 rate = MouseX.kr(100, SampleRate.ir);
137 x = Dbufrd(b); // read from buffer
139 y = Dbufwr(x, b); // write to buffer
140 Duty.ar(1 / rate, 0, y) * 0.1;