2 summary:: binary operator pattern
3 related:: Classes/Pnaryop, Classes/Punop, Classes/BinaryOpFunction
4 categories:: Streams-Patterns-Events>Patterns>Math
8 Returns a stream that applies the binary operator to the stream values of the receiver. Usually, this is the result of applying a binary operator (i.e. a method with one argument) to a pattern.
10 Examples of binary operators are: +, -, /, *, min, max, hypot ...
17 operator to be applied
20 a pattern (or compatible pattern input)
23 a pattern (or compatible pattern input)
30 a = Pbinop(\hypot, Pseries(0, 1, 12), Pseries(3, -1, 12));
34 // this is the same as:
37 a = Pseries(0, 1, 12).hypot(Pseries(3, -1, 12));
44 a = Pseries(0, 1, 12) hypot: Pseries(3, -1, 12);
50 Pseq([1, 2, 3]) / Pseq([3, 4, 5, 6]);
51 max(Pwhite(-10, 10, inf), Pseq([0, 2, 3, 4]));
57 SynthDef(\help_sinegrain,
58 { arg out=0, freq=440, sustain=0.05, amp=0.1;
60 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2, amp), doneAction:2);
61 Out.ar(out, SinOsc.ar(freq, 0, env))
67 a = Pn(Pbinop(\hypot, Pseries(0, 1, 34), Pseries(3, -1, 34)), inf).asStream;
70 Synth(\help_sinegrain, [\freq, a * 200 + 300].postln);
79 \instrument, \help_sinegrain,
80 \note, Pn(Pbinop(\hypot, Pwhite(0, 12, 13), Pseries(3, -1, 12)))
86 // these are the same as:
90 a = Pn(Pseries(0, 1, 34) hypot: Pseries(3, -1, 34), inf).asStream;
93 Synth(\help_sinegrain, [\freq, a * 200 + 300].postln);
103 \instrument, \help_sinegrain,
104 \note, Pn(Pwhite(0, 12, 13) hypot: Pseries(3, -1, 12))