linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / Psetp.schelp
blob19e938ffba772065f06d8add3dfc0bdafd0dd441
1 class:: Psetp
2 summary:: event pattern that sets values of one key
3 related:: Classes/Pbindf, Classes/Pset
4 categories:: Streams-Patterns-Events>Patterns>Filter
6 description::
8 Sets a value in an event stream until it ends, repeats this with new values until the value stream ends.
10 ClassMethods::
12 method::new
14 argument::value
15 can be a pattern, a stream or an array. The resulting stream ends when that incoming stream ends.
17 Examples::
19 code::
21 var a, b;
22 a = Psetp(\freq, Pseq([801, 1008],inf), Pbind(\dur, Pseq([0.5, 0.111, 0.22])));
23 x = a.asStream;
24 9.do({ x.next(Event.new).postln; });
27 //Psetp overrides incoming values:
30 var a, b;
31 a = Psetp(\freq, 801, Pbind(\freq, 108));
32 x = a.asStream;
33 9.do({ x.next(Event.new).postln; });
37 //sound example
40 SynthDef(\sinegrain,
41         { arg out=0, freq=440, sustain=0.02;
42                 var env;
43                 env = EnvGen.kr(Env.perc(0.001, sustain), 1, doneAction:2);
44                 Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))
45         }).add;
49 a = Pbind(\dur, Pseq([0.5, 0.3, 0.1]), \instrument, \sinegrain);
50 a = Psetp(\freq, Pseq([500, 600, 700], inf), a);
51 a.play;