2 summary:: n-ary operator pattern
3 related:: Classes/Pbinop, Classes/Punop, Classes/NAryOpFunction
4 categories:: Streams-Patterns-Events>Patterns>Math
8 Returns a stream that applies the n-ary operator to the stream values of the receiver, taking n-1 streams as arguments. Usually, this is the result of applying an n-ary operator (i.e. a method with more than one argument) to a pattern.
10 Examples of n-ary operators are: blend, linlin, linexp, explin, expexp, clip, fold, wrap.
17 operator to be applied
20 a pattern (or compatible pattern input)
23 a list of patterns (or compatible pattern inputs)
30 a = Pnaryop(\wrap, Pseries(0, 1, 12), [3, 7]);
34 // this is the same as:
37 a = Pseries(0, 1, 12).wrap(3, 7);
41 // the scale argument can also be a pattern:
45 a = Pnaryop(\wrap, Pseries(0, 1, 12), [Pseq([3, 4, 5], inf), Pseq([9, 7], inf)]);
51 Pwhite(0, 1, inf).linexp(0, 1, 200, 1000);
52 Pwhite(0, 1, inf).degreeToKey([0, 1, 3, 5, 7, 9, 11], 10);
53 blend(Pseq([1, 2, 3], inf), Pseq([3, 2, 1, 0], inf), Pseries(0, 0.01, inf));
59 SynthDef(\help_sinegrain,
60 { arg out=0, freq=440, sustain=0.05, amp=0.1;
62 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2, amp), doneAction:2);
63 Out.ar(out, SinOsc.ar(freq, 0, env))
69 a = Pnaryop(\wrap, Pseries(0, 1, 12), [3, 7]).asStream;
72 Synth(\help_sinegrain, [\freq, (val + 72) .midicps.postln]);
81 \instrument, \help_sinegrain,
82 \note, Pnaryop(\wrap, Pseries(0, 1, 12), [3, 7]);
88 // these are the same as:
92 a = Pseries(0, 1, 12).wrap(3, 7).asStream;
95 Synth(\help_sinegrain, [\freq, (val + 72) .midicps.postln]);
104 \instrument, \help_sinegrain,
105 \note, Pwhite(0, 12, inf).wrap(3, 7);