PLgbrown dynamic scope Pgbrown variant 


Part of: miSCellaneous


Inherits from: Pgbrown


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: Pgbrown, PLbrown, Event patterns and Functions, VarGui, VarGui shortcut builds



Creation / Class Methods


*new (lo, hi, step, length, envir)

Creates a new PLgbrown object.

lo - Symbol or Pgbrown lo arg. Defaults to 0.

If a Symbol is passed, lo can be assigned to an envir variable later on.

Can be dynamically replaced by Patterns or Streams.

hi - Symbol or Pgbrown hi arg. Defaults to 1.

If a Symbol is passed, hi can be assigned to an envir variable later on.

Can be dynamically replaced by Patterns or Streams.

step - Symbol or Pgbrown step arg. Defaults to 0.125.

If a Symbol is passed, step can be assigned to an envir variable later on.

Can be dynamically replaced by Patterns or Streams.

length - Symbol or Pgbrown length arg. Defaults to inf.

If a Symbol is passed, length 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, PLgbrown(\lo, \hi, \step) + [0, -7.4, -12.7], 

\dur, 0.1,

\amp, 0.05

);

)


// prepare Environments


(

e = (lo: 65, hi: 90, step: 0.01);

f = e.copy.put(\step, 0.05);

)



// run


(

e.use { x = p.play(quant: 0.2) };

f.use { y = p.play(quant: 0.2) };

)


// replace


(

e.lo = 65;

f.lo = 65;

e.hi = Pwhite(65, 67);

f.hi = Pwhite(65, 95);

f.step = 0.3

)


y.stop;


x.stop;