Pstep:
Filter:
Classes | Streams-Patterns-Events > Patterns > Time

Pstep : Pattern : AbstractFunction : Object

timed, sample-and-hold embedding of values
Subclasses: Pseg

Description

Pstep is a "sample and hold" pattern: The value returned by next is held at each value in levels for the corresponding duration in durs. This cycling is similar to Ptuple, in that the current repeat ends when eiher pattern returns nil.

Pstep measures elapsed time using the thread's logical time. That is, it assumes it will be evaluated only exactly when needed, not before.

See Pseg for a pattern whose value changes like an Env.

Class Methods

Pstep.new(levels, durs: 1, repeats: 1)

Create an instance of Pstep.

Arguments:

levels

A number, collection, or Pattern that returns the levels.

durs

A number, collection, or Pattern that returns segments durations in beats.

repeats

An integer, or inf.

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

.durs

.durs = value

.embedInStream(inval)

.list

.list = value

.repeats

.repeats = value

Examples