3 *ar { arg in = 0.0, dur = 0.1;
4 ^this.multiNew('audio', in, dur)
6 *kr { arg in = 0.0, dur = 0.1;
7 ^this.multiNew('control', in, dur)
9 signalRange { ^\unipolar }
17 *ar { arg in = 0.0, id = 0, value = 0.0;
18 this.multiNew('audio', in, id, value);
19 ^0.0 // SendTrig has no output
21 *kr { arg in = 0.0, id = 0, value = 0.0;
22 this.multiNew('control', in, id, value);
23 ^0.0 // SendTrig has no output
25 checkInputs { ^this.checkSameRateAsFirstInput }
30 SendReply : SendTrig {
31 *kr { arg trig = 0.0, cmdName = '/reply', values, replyID = -1;
32 if(values.containsSeqColl.not) { values = values.bubble };
33 [trig, cmdName, values, replyID].flop.do { |args|
34 this.new1('control', *args);
36 ^0.0 // SendReply has no output
39 *ar { arg trig = 0.0, cmdName = '/reply', values, replyID = -1;
40 if(values.containsSeqColl.not) { values = values.bubble };
41 [trig, cmdName, values, replyID].flop.do { |args|
42 this.new1('audio', *args);
44 ^0.0 // SendReply has no output
47 *new1 { arg rate, trig = 0.0, cmdName = '/reply', values, replyID = -1;
48 var ascii = cmdName.ascii;
49 ^super.new1(*[rate, trig, replyID, ascii.size].addAll(ascii).addAll(values));
54 checkInputs { ^this.checkSameRateAsFirstInput }
59 *ar { arg in = 0.0, trig = 0.0;
60 ^this.multiNew('audio', in, trig)
62 *kr { arg in = 0.0, trig = 0.0;
63 ^this.multiNew('control', in, trig)
73 *ar { arg trig = 0.0, reset = 0.0;
74 ^this.multiNew('audio', trig, reset)
76 *kr { arg trig = 0.0, reset = 0.0;
77 ^this.multiNew('control', trig, reset)
79 checkInputs { ^this.checkSameRateAsFirstInput }
83 *ar { arg in = 0.0, trig = 0.0;
84 ^this.multiNew('audio', in, trig)
86 *kr { arg in = 0.0, trig = 0.0;
87 ^this.multiNew('control', in, trig)
90 if (rate == 'control' && inputs.at(0).rate == 'audio', {
91 ^this.checkValidInputs
93 ^this.checkSameRateAsFirstInput
108 *ar { arg trig=0, reset=0, min=0, max=7, step=1, resetval;
109 ^this.multiNew('audio', trig, reset, min, max, step, resetval ? min)
111 *kr { arg trig=0, reset=0, min=0, max=7, step=1, resetval;
112 ^this.multiNew('control', trig, reset, min, max, step, resetval ? min)
114 checkInputs { ^this.checkSameRateAsFirstInput }
118 PulseDivider : UGen {
120 *ar { arg trig = 0.0, div = 2.0, start = 0.0;
121 ^this.multiNew('audio', trig, div, start)
123 *kr { arg trig = 0.0, div = 2.0, start = 0.0;
124 ^this.multiNew('control', trig, div, start)
129 SetResetFF : PulseCount {
134 *ar { arg trig = 0.0;
135 ^this.multiNew('audio', trig)
137 *kr { arg trig = 0.0;
138 ^this.multiNew('control', trig)
143 ZeroCrossing : UGen {
145 ^this.multiNew('audio', in)
148 ^this.multiNew('control', in)
150 checkInputs { ^this.checkSameRateAsFirstInput }
154 // output is the time between two triggers
155 *ar { arg trig = 0.0;
156 ^this.multiNew('audio', trig)
158 *kr { arg trig = 0.0;
159 ^this.multiNew('control', trig)
161 checkInputs { ^this.checkSameRateAsFirstInput }
165 // output sweeps up in value at rate per second
166 // the trigger resets to zero
167 *ar { arg trig = 0.0, rate = 1.0;
168 ^this.multiNew('audio', trig, rate)
170 *kr { arg trig = 0.0, rate = 1.0;
171 ^this.multiNew('control', trig, rate)
176 *ar { arg trig = 0.0, rate = 1.0, start = 0.0, end = 1.0, resetPos = 0.0;
177 ^this.multiNew('audio', trig, rate, start, end, resetPos)
179 *kr { arg trig = 0.0, rate = 1.0, start = 0.0, end = 1.0, resetPos = 0.0;
180 ^this.multiNew('control', trig, rate, start, end, resetPos)
184 PeakFollower : UGen {
186 *ar { arg in = 0.0, decay = 0.999;
187 ^this.multiNew('audio', in, decay)
189 *kr { arg in = 0.0, decay = 0.999;
190 ^this.multiNew('control', in, decay)
194 Pitch : MultiOutUGen {
196 *kr { arg in = 0.0, initFreq = 440.0, minFreq = 60.0, maxFreq = 4000.0,
197 execFreq = 100.0, maxBinsPerOctave = 16, median = 1,
198 ampThreshold = 0.01, peakThreshold = 0.5, downSample = 1, clar=0;
199 ^this.multiNew('control', in, initFreq, minFreq, maxFreq, execFreq,
200 maxBinsPerOctave, median, ampThreshold, peakThreshold, downSample, clar)
202 init { arg ... theInputs;
204 ^this.initOutputs(2, rate);
210 *ar { arg in = 0.0, lo = 0.0, hi = 1.0;
211 ^this.multiNew('audio', in, lo, hi)
213 *kr { arg in = 0.0, lo = 0.0, hi = 1.0;
214 ^this.multiNew('control', in, lo, hi)
216 *ir { arg in = 0.0, lo = 0.0, hi = 1.0;
217 ^this.multiNew('scalar', in, lo, hi)
223 *ar { arg x = 0.0, y = 0.0, rect;
224 ^this.multiNew('audio', x, y, rect.left, rect.top,
225 rect.right, rect.bottom)
227 *kr { arg x = 0.0, y = 0.0, rect;
228 ^this.multiNew('control', x, y, rect.left, rect.top,
229 rect.right, rect.bottom)
236 // *ar { arg in = 0.0, a = 0.2, b = 0.4, c = 0.6, d = 0.8;
237 // ^this.multiNew('audio', in, a, b, c, d)
239 // *kr { arg in = 0.0, a = 0.2, b = 0.4, c = 0.6, d = 0.8;
240 // ^this.multiNew('control', in, a, b, c, d)
251 *ar { arg a = 0.0, b = 0.0;
252 ^this.multiNew('audio', a, b)
254 *kr { arg a = 0.0, b = 0.0;
255 ^this.multiNew('control', a, b)
259 LeastChange : MostChange {}
263 *ar { arg in=0.0, diff=0.01;
264 ^this.multiNew('audio', in, diff)
266 *kr { arg in=0.0, diff=0.01;
267 ^this.multiNew('control', in, diff)
273 *kr { arg sig, replyRate = 20.0, peakLag = 3, cmdName = '/reply', replyID = -1;
274 this.new1('control', sig.asArray, replyRate, peakLag, cmdName, replyID);
275 ^0.0 // SendPeakRMS has no output
278 *ar { arg sig, replyRate = 20.0, peakLag = 3, cmdName = '/reply', replyID = -1;
279 this.new1('audio', sig.asArray, replyRate, peakLag, cmdName, replyID);
280 ^0.0 // SendPeakRMS has no output
283 *new1 { arg rate, sig, replyRate, peakLag, cmdName, replyID;
284 var ascii = cmdName.ascii;
285 var args = [rate, replyRate, peakLag, replyID, sig.size]