PLseq dynamic scope Pseq variant
Part of: miSCellaneous
Inherits from: PL_ListPattern
Takes Symbol args for later reference by the Streams, which will read from variables in the Environments of their instantiation. See PLx suite.
See also: Pseq, PLser, Event patterns and Functions, VarGui, VarGui shortcut builds
Creation / Class Methods
*new (list, repeats, offset, envir)
Creates a new PLseq object.
list - Symbol or Pseq list arg.
If a Symbol is passed, list can be assigned to an envir variable later on.
This lists's elements can be dynamically replaced by Patterns or Streams.
repeats - Symbol or Pseq repeats arg. Defaults to inf.
If a Symbol is passed, repeats can be assigned to an envir variable later on.
offset - Symbol or Pseq offset arg. Defaults to 0.
If a Symbol is passed, offset can be assigned to an envir variable later on.
envir - Dictionary or one of the Symbols
\top, \t (topEnvironment), \current, \c (currentEnvironment).
Dictionary to be taken for variable reference. Defaults to \current.
Examples
(
s = Server.local;
Server.default = s;
s.boot;
)
// definition for future reference in arbitrary Environments
(
p = Pbind(
\midinote, PLseq(\a),
\dur, 0.1
);
)
// assign a value to variable ~a in current Environment,
// play there.
// PLseq defaults to repeats = inf, Pseq defaults to repeats = 1
(
~a = (67..70) ++ Pseq((99..70));
x = p.play;
)
// try replacing Pseq stream (while chromatic line down)
~a[4] = 73;
// replace whole list
~a = (60..65);
x.stop;
//////////////////////
// placeholder may also get lists of event patterns
(
p = PLseq(\a);
~a = [ Pbind(
\midinote, Pwhite(60,65,3),
\dur, 0.2
),
Pbind(
\midinote, Pwhite(80,85,3),
\dur, 0.2
)
];
x = p.play;
)
// replace array element
(
~a[0] = Pbind(
\midinote, Pwhite(70,75,3) + [0, 5],
\dur, 0.15
);
)
// replace whole array
(
~a = [ Pbind(
\midinote, Pwhite(60,65,3),
\dur, 0.05
),
Pbind(
\midinote, Pwhite(70,90,2),
\dur, 0.25
)
];
)
x.stop;