Skip to content

Instantly share code, notes, and snippets.

@datramt
Created June 18, 2019 18:03
Show Gist options
  • Save datramt/3a28f836e165a69db4ae468a1cacc0cd to your computer and use it in GitHub Desktop.
Save datramt/3a28f836e165a69db4ae468a1cacc0cd to your computer and use it in GitHub Desktop.
control synth example
use_synth :tb303
fitted_duration = 4
my_mel = ((scale :a3, :minor) + (knit :a2, 8)).repeat.shuffle
my_alt_mel = ((scale :e3, :minor) + (knit :e2, 8)).mirror.shuffle
my_current_mel = my_mel
quantity_of_notes = my_current_mel.length
def divvy_durations (q, d)
sleep_times = (knit d.to_f/q, q)
return sleep_times
end
my_sleep_times = divvy_durations(quantity_of_notes, fitted_duration)
live_loop :sticky_mel do
with_fx :lpf, cutoff: 65 do
tick_reset(:m)
tick_reset(:s)
sticky = play my_current_mel.tick(:m), release: 0, note_slide: 0.01, decay: fitted_duration-0.01
quantity_of_notes.times do
sleep my_sleep_times.look(:s)
control sticky, note: my_current_mel.tick(:m)
end
end
end
live_loop :bass_walk do
with_fx :slicer, pulse_width: 0.8, wave: 1, phase: 1/8.0 do
with_fx :lpf, cutoff: 60 do
play ((knit :a1, 4) + (scale :a1, :minor)).take(8).tick, release: 4
sleep 4
end
end
end
live_loop :beat do
with_fx :lpf, cutoff: 90 do
8.times do
sample :bd_tek
sleep 0.5
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment