Play current synth
play
[note (symbol_or_number)]
Play note with current synth. Accepts a set of standard options which include control of an amplitude envelope with attack, decay, sustain and release phases. These phases are triggered in order, so the duration of the sound is attack + decay + sustain + release times. The duration of the sound does not affect any other notes. Code continues executing whilst the sound is playing through its envelope phases. Accepts optional args for modification of the synth being played. See each synth's documentation for synth-specific opts. See use_synth and with_synth for changing the current synth. If note is nil, :r or :rest, play is ignored and treated as a rest.
Introduced in v2.0
|
play 50 |
# Plays note 50 on the current synth |
|
play 50, attack: 1 |
# Plays note 50 with a fade-in time of 1s |
|
play 62, pan: -1, release: 3 |
# Play note 62 in the left ear with a fade-out time of 3s. |