Pfset:
Filter:

Pfset : FuncFilterPattern : FilterPattern : Pattern : AbstractFunction : Object

Insert an environment into the event prototype before evaluating the supplied pattern

Description

Good for setting default values or loading server objects.

Class Methods

Pfset.new(func, pattern, cleanupFunc)

Arguments:

func

Use environment variable syntax (e.g., ~x = 0) to store values in the internal environment. These values are copied into the event prototype before running the supplied pattern.


pattern

An event pattern (such as Pbind).


cleanupFunc

Optional. A function to evaluate when the pattern is stopped, or when the supplied pattern runs out of values. For example, if you loaded a Buffer in the initializer function, you could free it in the cleanupFunc.

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

.cleanupFunc

.cleanupFunc = value

.embedInStream(inevent)

Examples

Pfset does not override values placed into the event by the inner pattern:

Sound example