synth synth_name (symbol)
Trigger specified synth with given opts. Bypasses current_synth
value, yet still honours current_synth_defaults
. When using synth
, the note is no longer an explicit argument but an opt with the key note:
.
If note: opt is nil
, :r
or :rest
, play is ignored and treated as a rest. Also, if the on:
opt is specified and returns false
, or nil
then play is similarly ignored and treated as a rest.
If the synth name is nil
behaviour is identical to that of play
in that the current_synth
will determine the actual synth triggered.
If a block is given, it is assumed to take one arg which will be the controllable synth node and the body of the block is run in an implicit in_thread
. This allows for asynchronous control of the synth without interfering with time. For synchronous control capture the result of synth
as a variable and use that.
Note that the default opts listed are only a guide to the most common opts across all the synths. Not all synths support all the default opts and each synth typically supports many more opts specific to that synth. For example, the :tb303
synth supports 45 unique opts. For a full list of a synth’s opts see its documentation in the Help system. This can be accessed directly by clicking on the name of the synth and using the shortcut C-i
Introduced in v2.0
amp: |
The amplitude of the note |
amp_slide: |
The duration in beats for amplitude changes to take place |
pan: |
The stereo position of the sound. -1 is left, 0 is in the middle and 1 is on the right. You may use a value in between -1 and 1 such as 0.25 |
pan_slide: |
The duration in beats for the pan value to change |
attack: |
Amount of time (in beats) for sound to reach full amplitude (attack_level). A short attack (i.e. 0.01) makes the initial part of the sound very percussive like a sharp tap. A longer attack (i.e 1) fades the sound in gently. |
decay: |
Amount of time (in beats) for the sound to move from full amplitude (attack_level) to the sustain amplitude (sustain_level). |
sustain: |
Amount of time (in beats) for sound to remain at sustain level amplitude. Longer sustain values result in longer sounds. Full length of sound is attack + decay + sustain + release. |
release: |
Amount of time (in beats) for sound to move from sustain level amplitude to silent. A short release (i.e. 0.01) makes the final part of the sound very percussive (potentially resulting in a click). A longer release (i.e 1) fades the sound out gently. |
attack_level: |
Amplitude level reached after attack phase and immediately before decay phase |
decay_level: |
Amplitude level reached after decay phase and immediately before sustain phase. Defaults to sustain_level unless explicitly set |
sustain_level: |
Amplitude level reached after decay phase and immediately before release phase. |
env_curve: |
Select the shape of the curve between levels in the envelope. 1=linear, 2=exponential, 3=sine, 4=welch, 6=squared, 7=cubed |
slide: |
Default slide time in beats for all slide opts. Individually specified slide opts will override this value |
pitch: |
Pitch adjustment in semitones. 1 is up a semitone, 12 is up an octave, -12 is down an octave etc. Decimal numbers can be used for fine tuning. |
on: |
If specified and false/nil/0 will stop the synth from being played. Ensures all opts are evaluated. |
# Example 1 | |
|
|
# Example 2 | |
|
|
# Example 3 | |
|
|
# Example 4 | |
|
|
# Example 5 | |
|
|
# Example 6 | |
|
|
# Example 7 | |
|
|