4 bufnum - an index to a buffer
5 freq - frequency in cycles per second
7 mul - multiply by signal or scalar
8 add - add to signal or scalar
13 arg bufnum, freq=440.0, phase=0.0, mul=1.0, add=0.0;
14 ^this.multiNew('audio', bufnum, freq, phase).madd(mul, add)
17 arg bufnum, freq=440.0, phase=0.0, mul=1.0, add=0.0;
18 ^this.multiNew('control', bufnum, freq, phase).madd(mul, add)
24 arg freq=440.0, phase=0.0, mul=1.0, add=0.0;
25 ^this.multiNew('audio', freq, phase).madd(mul, add)
28 arg freq=440.0, phase=0.0, mul=1.0, add=0.0;
29 ^this.multiNew('control', freq, phase).madd(mul, add)
35 arg freq=440.0, feedback=0.0, mul=1.0, add=0.0;
36 ^this.multiNew('audio', freq, feedback).madd(mul, add)
39 arg freq=440.0, feedback=0.0, mul=1.0, add=0.0;
40 ^this.multiNew('control', freq, feedback).madd(mul, add)
46 arg bufnum, freq=440.0, phase=0.0, mul=1.0, add=0.0;
47 ^this.multiNew('audio', bufnum, freq, phase).madd(mul, add)
50 arg bufnum, freq=440.0, phase=0.0, mul=1.0, add=0.0;
51 ^this.multiNew('control', bufnum, freq, phase).madd(mul, add)
58 arg bufpos, freq=440.0, phase=0.0, mul=1.0, add=0.0;
59 ^this.multiNew('audio', bufpos, freq, phase).madd(mul, add)
62 arg bufpos, freq=440.0, phase=0.0, mul=1.0, add=0.0;
63 ^this.multiNew('control', bufpos, freq, phase).madd(mul, add)
69 arg bufpos, freq1=110.0, freq2=220.0, freq3=440.0, mul=1.0, add=0.0;
70 ^this.multiNew('audio', bufpos, freq1, freq2, freq3).madd(mul, add)
73 arg bufpos, freq1=110.0, freq2=220.0, freq3=440.0, mul=1.0, add=0.0;
74 ^this.multiNew('control', bufpos, freq1, freq2, freq3).madd(mul, add)
80 arg bufnum, freq=440.0, beats=0.5, mul=1.0, add=0.0;
81 ^this.multiNew('audio', bufnum, freq, beats).madd(mul, add)
84 arg bufnum, freq=440.0, beats=0.5, mul=1.0, add=0.0;
85 ^this.multiNew('control', bufnum, freq, beats).madd(mul, add)
91 arg fundfreq = 440.0, formfreq = 1760.0, bwfreq = 880.0, mul = 1.0, add = 0.0;
92 ^this.multiNew('audio', fundfreq, formfreq, bwfreq).madd(mul, add)
98 arg freq = 440.0, iphase = 0.0, mul = 1.0, add = 0.0;
99 ^this.multiNew('audio', freq, iphase).madd(mul, add)
102 arg freq = 440.0, iphase = 0.0, mul = 1.0, add = 0.0;
103 ^this.multiNew('control', freq, iphase).madd(mul, add)
121 arg duration = 1, width = 0.1, iphase = 0.0, loop = 1, doneAction = 0;
122 ^this.multiNew('audio', duration, width, iphase, loop, doneAction)
125 arg duration = 1, width = 0.1, iphase = 0.0, loop = 1, doneAction = 0;
126 ^this.multiNew('control', duration, width, iphase, loop, doneAction)
128 range { arg min = 0, max = 1;
129 ^this.linlin(this.minval, 1, min, max)
132 var width = inputs[1];
133 ^exp(1.0 / (-2.0 * squared(width)))
140 arg freq = 440.0, iphase = 0.0, width = 0.5, mul = 1.0, add = 0.0;
141 ^this.multiNew('audio', freq, iphase, width).madd(mul, add)
144 arg freq = 440.0, iphase = 0.0, width = 0.5, mul = 1.0, add = 0.0;
145 ^this.multiNew('control', freq, iphase, width).madd(mul, add)
147 signalRange { ^\unipolar }
152 arg freq = 440.0, iphase = 0.0, width = 0.5, mul = 1.0, add = 0.0;
153 ^this.multiNew('audio', freq, iphase, width).madd(mul, add)
156 arg freq = 440.0, iphase = 0.0, width = 0.5, mul = 1.0, add = 0.0;
157 ^this.multiNew('control', freq, iphase, width).madd(mul, add)
163 arg freq = 440.0, phase = 0.0, mul = 1.0, add = 0.0;
164 ^this.multiNew('audio', freq, phase).madd(mul, add)
167 arg freq = 440.0, phase = 0.0, mul = 1.0, add = 0.0;
168 ^this.multiNew('control', freq, phase).madd(mul, add)
170 signalRange { ^\unipolar }
176 arg syncFreq = 440.0, sawFreq = 440.0, mul = 1.0, add = 0.0;
177 ^this.multiNew('audio', syncFreq, sawFreq).madd(mul, add)
180 arg syncFreq = 440.0, sawFreq = 440.0, mul = 1.0, add = 0.0;
181 ^this.multiNew('control', syncFreq, sawFreq).madd(mul, add)
186 //TPulse : UGen {//exception in GrafDef_Load: UGen 'TPulse' not installed.
188 // arg trig = 0.0, freq = 440.0, width = 0.5, mul = 1.0, add = 0.0;
189 // ^this.multiNew('audio', trig, freq, width).madd(mul, add)
192 // arg trig = 0.0, freq = 440.0, width = 0.5, mul = 1.0, add = 0.0;
193 // ^this.multiNew('control', trig, freq, width).madd(mul, add)
195 // signalRange { ^\unipolar }
200 arg bufnum, in = 0.0, mul = 1.0, add = 0.0;
201 ^this.multiNew('audio', bufnum, in).madd(mul, add)
204 arg bufnum, in = 0.0, mul = 1.0, add = 0.0;
205 ^this.multiNew('control', bufnum, in).madd(mul, add)
212 IndexInBetween : Index {
215 DetectIndex : Index {
224 DegreeToKey : PureUGen {
226 arg bufnum, in = 0.0, octave = 12.0, mul = 1.0, add = 0.0;
227 ^this.multiNew('audio', bufnum, in, octave).madd(mul, add)
230 arg bufnum, in = 0.0, octave = 12.0, mul = 1.0, add = 0.0;
231 ^this.multiNew('control', bufnum, in, octave).madd(mul, add)
238 ^this.multiNewList(['audio', which] ++ array)
242 ^this.multiNewList(['control', which] ++ array)
245 if (rate == 'audio', {
246 for(1, inputs.size - 1, { arg i;
247 if (inputs.at(i).rate != 'audio', {
248 ^("input was not audio rate: " + inputs.at(i));
252 ^this.checkValidInputs
257 *new1 { arg rate, which, array;
258 var selector = UGen.methodSelectorForRate(rate);
259 ^this.crossfadeClass.perform(selector,
260 Select.perform(selector, which.round(2), array),
261 Select.perform(selector, which.trunc(2) + 1, array),
262 (which * 2 - 1).fold2(1)
265 *ar { arg which, array, wrap=1;
266 ^this.new1(\audio, which, array, wrap);
268 *kr { arg which, array, wrap=1;
269 ^this.new1(\control, which, array, wrap);
276 LinSelectX : SelectX {
282 SelectXFocus { // does not wrap (yet).
283 *new { arg which, array, focus=1;
284 ^Mix(array.collect({ arg in, i;
285 (1 - ((which-i).abs * focus) ).max(0) * in;
288 *ar { arg which, array, focus=1;
289 ^this.new(which, array, focus);
291 *kr { arg which, array, focus=1;
292 ^this.new(which, array, focus);
298 arg freq = 440.0, rate = 6, depth = 0.02, delay = 0.0, onset = 0.0,
299 rateVariation = 0.04, depthVariation = 0.1, iphase = 0.0;
300 ^this.multiNew('audio', freq, rate, depth, delay, onset, rateVariation, depthVariation, iphase)
303 arg freq = 440.0, rate = 6, depth = 0.02, delay = 0.0, onset = 0.0,
304 rateVariation = 0.04, depthVariation = 0.1, iphase = 0.0;
305 ^this.multiNew('control', freq, rate, depth, delay, onset, rateVariation, depthVariation, iphase)
311 *ar { arg trig, array;
312 ^Select.ar(TIRand.kr(0, array.lastIndex, trig), array)
315 *kr { arg trig, array;
316 ^Select.kr(TIRand.kr(0, array.lastIndex, trig), array)
323 *ar { arg trig, array, weights, normalize=0;
324 ^Select.ar(TWindex.ar(trig, weights, normalize), array)
326 *kr { arg trig, array, weights, normalize=0;
327 ^Select.kr(TWindex.kr(trig, weights, normalize), array)