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.
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.
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.Rest
instance, the Rest
class, or either of the symbols \
or \r
. If any item meets the condition, the event will be considered a rest and it will not take action when played.Rest(1) * 2 == Rest(2)
.All methods of Rest except *new are private, and should not be used directly.
Create an instance of Rest, with a value to be used in the resulting rest event.
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 |
The rest of a rest is always a rest. This idempotence is implemented by Rest's superclass Operand.
returns true
returns the value.
This method implements the following behavior.
This makes comparisons work:
Using Rest instances in a pitch stream
Using a Rest instance in a duration stream
In addition to Rest, in events, rests can be specified in two other ways (legacy usages).