linux: shared memory interface - link with librt
[supercollider.git] / HelpSource / Classes / Pset.schelp
blob0421daf049a7246cd04aea4b740c9f48a5dff5f8
1 class:: Pset
2 summary:: event pattern that sets values of one key
3 related:: Classes/Pbindf, Classes/Psetp
4 categories:: Streams-Patterns-Events>Patterns>Filter
6 description::
8 Pset sets a value in an event stream. It acts like one key in a link::Classes/Pbindf::.
9 code::
11 var a, b;
12 a = Pset(\freq, 801, Pbind(\dur, 0.5));
13 x = a.asStream;
14 9.do({ x.next(Event.new).postln; });
18 ClassMethods::
20 method::new
22 argument::value
23 can be a pattern or a stream. The resulting stream ends when that incoming stream ends.
25 Examples::
27 code::
28 //Pset overrides incoming values:
31 var a, b;
32 a = Pset(\freq, 801, Pbind(\freq, 108));
33 x = a.asStream;
34 9.do({ x.next(Event.new).postln; });
39 var a, b;
40 a = Pset(\freq, Pseq([401, 801], 2), Pbind(\dur, 0.5));
41 x = a.asStream;
42 9.do({ x.next(Event.new).postln; });
46 //sound example
49 SynthDef(\sinegrain,
50         { arg out=0, freq=440, sustain=0.02;
51                 var env;
52                 env = EnvGen.kr(Env.perc(0.001, sustain), 1, doneAction:2);
53                 Out.ar(out, SinOsc.ar(freq, 0, env * 0.1))
54         }).add;
58 a = Pbind(\dur, 0.5, \instrument, \sinegrain);
59 a = Pset(\freq, Pseq([500, 600, 700], inf), a);
60 a = Pset(\legato, Pseq([0.01, 1],inf), a);
61 a.play;