PLnaryop dynamic scope Pnaryop variant 


Part of: miSCellaneous


Inherits from: Pnaryop


Takes Symbol args for later reference by the Streams, which will read from variables in the Environments of their instantiation. See PLx suite. For replacing operators dynamically take PLnaryFunc with the operator wrapped into a Function.


See also:, Pnaryop, PLnaryFunc, Event patterns and Functions, VarGui, VarGui shortcut builds



Creation / Class Methods


*new (operator, pat, arglist, envir)

Creates a new PLnaryop object.

operator - Symbol or Pnaryop operator arg. 

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

pat - Symbol or Pnaryop pattern arg. 

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

Can be dynamically replaced by Patterns or Streams.

arglist - Symbols or Pnaryop arglist arg. 

If Symbols are passed, arglist args can be assigned to envir variables later on.

Can be dynamically replaced by Patterns or Streams.

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, PLnaryop('+', \src, [\dev]),

\dur, 0.1

);

)



// define Environment and play


(

e = (src: PLseq([61,62]), dev: Pbrown(-5, 5, 0.2) );


e.use { x = p.play };

)



// replace


e.dev = PLseq((0, 0.5..7));


e.dev = Pbrown(-5, 5, 0.2);


e.src = PLseq([61,64,65]);



x.stop;



See also PLx suite Ex. 5a.