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)
32 a = Pbinop(\hypot, Pseries(0, 1, 12), Pseries(3, -1, 12));
36 // this is the same as:
39 a = Pseries(0, 1, 12).hypot(Pseries(3, -1, 12));
46 a = Pseries(0, 1, 12) hypot: Pseries(3, -1, 12);
52 Pseq([1, 2, 3]) / Pseq([3, 4, 5, 6]);
53 max(Pwhite(-10, 10, inf), Pseq([0, 2, 3, 4]));
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 = Pn(Pbinop(\hypot, Pseries(0, 1, 34), Pseries(3, -1, 34)), inf).asStream;
72 Synth(\help_sinegrain, [\freq, a * 200 + 300].postln);
81 \instrument, \help_sinegrain,
82 \note, Pn(Pbinop(\hypot, Pwhite(0, 12, 13), Pseries(3, -1, 12)))
88 // these are the same as:
92 a = Pn(Pseries(0, 1, 34) hypot: Pseries(3, -1, 34), inf).asStream;
95 Synth(\help_sinegrain, [\freq, a * 200 + 300].postln);
105 \instrument, \help_sinegrain,
106 \note, Pn(Pwhite(0, 12, 13) hypot: Pseries(3, -1, 12))