Rest:
Filter:

Rest : Operand : AbstractFunction : Object

Represents a rest in event patterns
Source: Rest.sc

Description

A Rest may be used in event patterns to indicate that the resulting event should be a rest (i.e., silent). It should be used in one of the child patterns belonging to a Pbind, for instance.

Expressing rests in event patterns

The Rest class allows rests to be indicated in any stream, not only frequency or event type. Also, using the duration argument (see the *new method below), rests may be embedded into a duration stream. That is, rests may be treated as part of the rhythmic specification, rather than the pitch specification.

NOTE: As of SuperCollider 3.9, Rest's behavior has changed to be more intuitive. Note that you have to now use Rest() - the shortcut of Rest as class directly is not supported anymore.

Usage

Class Methods

All methods of Rest except *new are private, and should not be used directly.

Rest.new(value: 1)

Create an instance of Rest, with a value to be used in the resulting rest event.

Arguments:

value

The Rest instance's numeric value, to be used in math operations. Note that a Rest's value is ignored for most Event keys (assuming the Event does nothing in response to .play). If a Rest appears in a rhythm key (dur or delta), then the number is the time until the next event. Consequently, numeric Rests are often used for duration -- but there is no requirement that a Rest's value must be a duration.

Discussion:

The rest of a rest is always a rest. This idempotence is implemented by Rest's superclass Operand.

Inherited class methods

Instance Methods

.isRest

returns true

.unwrapBoolean

returns the value.

Discussion:

This method implements the following behavior.

This makes comparisons work:

Inherited instance methods

Examples

Using Rest instances in a pitch stream

Using a Rest instance in a duration stream

Alternatives to Rest

In addition to Rest, in events, rests can be specified in two other ways (legacy usages).