Pfunc:
Filter:
Classes | Streams-Patterns-Events > Patterns > Function

Pfunc : Pattern : AbstractFunction : Object

Function pattern
Source: Patterns.sc

Description

Returns a Stream that returns values from the nextFunc.

Class Methods

Pfunc.new(nextFunc, resetFunc)

Arguments:

nextFunc

Stream function. In an event stream nextFunc receives the current Event as argument, and more generally the argument passed to the stream's next call.

resetFunc

Function that is called when the stream is reset. resetFunc receives no arguments.

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

.asStream

.nextFunc

.nextFunc = value

.resetFunc

.resetFunc = value

Examples

Numeric stream examples

Event stream (sound) examples:

When an Event is played, if \freq is set then \degree is ignored (due to the Event.default machinery). In a chain of Patterns, a Pfunc can be used to delete a key from the Event stream; this can even be done inside a Pbind.