2 summary:: unary operator pattern
3 related:: Classes/Pbinop, Classes/Pnaryop, Classes/UnaryOpFunction
4 categories:: Streams-Patterns-Events>Patterns>Math
8 Returns a stream that applies the unary operator to the stream values of the receiver. Usually, this is the result of applying a unary operator (i.e. a method with one argument) to a pattern.
10 Examples of unary operators are: squared, sqrt, sin, tan ...
17 operator to be applied
20 a pattern (or compatible pattern input)
27 a = Punop(\sqrt, Pseries(0, 1, 12));
31 // this is the same as:
34 a = Pseries(0, 1, 12).sqrt;
39 Pseq([1, 2, 3]).squared;
40 Pseq([0.2, 0.5, 0.8]).coin;
41 Pwhite(-100, 100, inf).abs;
47 SynthDef(\help_sinegrain,
48 { arg out=0, freq=440, sustain=0.05, amp=0.1;
50 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2, amp), doneAction:2);
51 Out.ar(out, SinOsc.ar(freq, 0, env))
57 a = Pn(Punop(\sqrt, Pseries(0, 1, 12))).asStream;
60 Synth(\help_sinegrain, [\freq, a * 200 + 300].postln);
69 \instrument, \help_sinegrain,
70 \note, Pn(Punop(\sqrt, Pseries(0, 1, 12)))
75 // these are the same as:
79 a = Pn(Pseries(0, 1, 12).sqrt).asStream;
82 Synth(\help_sinegrain, [\freq, a * 200 + 300].postln);
91 \instrument, \help_sinegrain,
92 \note, Pn(Pseries(0, 1, 12).sqrt)