Trigger specific synth

synth  synth_name (symbol)

Trigger specified synth with given arguments. Bypasses current synth value, yet still honours synth defaults.

Introduced in v2.0

Options

slide:

Default slide time in beats for all slide opts. Individually specified slide opts will override this value

on:

If specified and false/nil/0 will stop the synth from being played. Ensures all opts are evaluated.

Examples

# Example 1

synth :fm, note: 60, amp: 0.5



# Play note 60 of the :fm synth with an amplitude of 0.5



# Example 2

use_synth_defaults release: 5
synth :dsaw, note: 50



 
# Play note 50 of the :dsaw synth with a release of 5



# Example 3


notes = (scale :e3, :minor_pentatonic, num_octaves: 2)

live_loop :rhyth do
  8.times do
    trig = (spread 3, 7).tick(:rhyth)
    synth :tri, on: trig, note: notes.tick, release: 0.1 
                                                         
                                                         
    sleep 0.125
  end
end


live_loop :rhyth2 do
  8.times do
    trig = (spread 3, 7).tick(:rhyth)
    synth :saw, note: notes.tick, release: 0.1 if trig 
                                                       
                                                       
    sleep 0.125
  end
end


# on: vs if
 
 
 
 
 
# Here, we're calling notes.tick
# every time we attempt to play the synth
# so the notes rise faster than rhyth2
 
 
 
 
 
 
 
 
# Here, we're calling notes.tick
# only when the spread says to play
# so the notes rise slower than rhyth