PLbindef:
Filter:
miSCellaneous_lib/Classes (extension) | Libraries > miSCellaneous > PLx suite | Streams-Patterns-Events > PLx suite

PLbindef
ExtensionExtension

wrapper for Pbindef which allows replacement in object prototyping style

Description

PLbindef works like a normal Pbindef and, like the latter, uses Pdef's global bookkeeping, but replacement of key streams can be done in object prototyping style with a dedicated PLbindefEnvironment, which also holds player methods. This hybrid Environment is itself assigned to the PLbindef's name in an Environment of choice, by default the current Environment. Setting can thus be done in very condensed syntax, also in combination with EventShortcuts. For more info on object prototyping see Environment: Using Environments as object prototypes.

NOTE: PLbindefs are registered globally in the same Dictionary as Pdefs, Pbindefs and PLbindefPars. It's recommended to do cleanup with remove or Pdef.removeAll after using PLbindef / PLbindefPar as in examples below. Otherwise unwanted or strange behaviour might be caused by leftover sources when playing a new PLbindef / PLbindefPar example with the same key. With SC >= 3.7 occasional posts of the default parent event occur with Pbindef, so also with PLbindef, this doesn't cause problems though.

Class Methods

.new

Creates a new PLbindef object or sets sources as with Pbindef.

Arguments:

... args

First arg should be the name, followed by key/value pairs for the Pbindef. The last arg can be an optional environment which determines where the corresponding PLbindefEnvironment should be stored, by default this is the current Environment at instantiation time.

Instance Methods

.clear

As with Pdef: -clear, but in addition remove name entry from refEnvir.

.sourceEnvir

Getter for PLbindef's PLbindefEnvironment.

.refEnvir

Getter for the Environment where PLbindef's PLbindefEnvironment is associated with PLbindef's key.

 

Examples

Ex.1) Setting key streams

Ex.2) PLbindef with EventShortcuts

Use SynthDefs from above.

Ex.3) PLbindef with VarGui

Use SynthDef from above.

Ex.4) PLbindef with PbindFx

See also Ex.7c: Replacement with Pbindef

Ex.5) Passing a refEnvir