2 summary:: embed event streams in parallel and put each in its own group
3 related:: Classes/Ppar, Classes/Pbus, Classes/Pgroup
4 categories:: Streams-Patterns-Events>Patterns>Parallel
8 Embeds several event streams so that they form a single output stream with all their events in temporal order. When one stream ends, the other streams are further embedded until all have ended.
11 In order to fully separate these layers from other synths, use link::Classes/Pbus::.
14 See link::Classes/Pgroup:: for a description of the code::\groupReleaseTime:: event key.
21 list of patterns or streams.
24 repeat the whole pattern n times.
29 // an example analogous to the one in the Pfx helpfile
32 SynthDef(\echo, { arg out=0, maxdtime=0.2, dtime=0.2, decay=2, gate=1;
34 env = Linen.kr(gate, 0.05, 1, 0.1, 2);
36 XOut.ar(out, env, CombL.ar(in * env, maxdtime, dtime, decay, 1, in));
37 }, [\ir, \ir, 0.1, 0.1, 0]).add;
39 SynthDef(\distort, { arg out=0, pregain=40, amp=0.2, gate=1;
41 env = Linen.kr(gate, 0.05, 1, 0.1, 2);
42 XOut.ar(out, env, (In.ar(out, 2) * pregain).distort * amp);
43 }, [\ir, 0.1, 0.1, 0]).add;
45 SynthDef(\wah, { arg out=0, gate=1, rate=0.3;
47 env = Linen.kr(gate, 0.05, 1, 0.4, 2);
49 XOut.ar(out, env, RLPF.ar(in, LinExp.kr(LFNoise1.kr(rate), -1, 1, 200, 8000), 0.1).softclip * 0.8);
58 Pbind(\degree, Prand((0..7), inf), \dur, 0.3, \legato, 0.2),
59 Pbind(\instrument, \echo, \dur, 3, \legato, 1.1,
60 \dtime, Pwhite(0.01, 0.1, inf), \decay, 3),
61 Pbind(\instrument, \distort, \dur, 1.2, \legato, 1.1,
62 \pregain, Pwhite(1, 20, inf), \amp, 0.25),
63 Pbind(\instrument, \wah, \dur, 4.0, \legato, 1.1,
64 \rate, Pwhite(0.1, 3, inf))
73 SynthDef(\gap, { arg out, sustain=1.0, attack=0.0001, decay=0.01, leak;
75 level = EnvGen.ar(Env.linen(attack, sustain, decay, 1-leak), doneAction:2);
76 XOut.ar(out, level, Silent.ar ! 2)
79 SynthDef(\help_sinegrain,
80 { arg out=0, freq=440, sustain=0.05;
82 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction:2);
83 Out.ar(out, SinOsc.ar(freq, 0, env))
88 // play a layered pattern with gaps and overlays
91 \instrument, \help_sinegrain,
92 \degree, Pn(Plazy({ Prand([0, 4, 5], 16) + 5.rand })) + Prand(#[0, [0, 3], [0, 7]], inf),
93 \dur, Prand([0.25, 0.5, 1.0], inf),
94 \scale, #[0, 3, 5, 9, 10]
98 \dur, Prand([0.25, 0.5, 1.0], inf) * Pstutter(inf, Prand([0.25, 1, 2],1)),
99 \legato, Prand([0.25, 0.5, 1.0], inf),
102 a = Pbus(Pgpar([x, y, x, y, x, y]));