Skip to content

Instantly share code, notes, and snippets.

@st01c
Forked from nicoder/20150308_sonic_pi.rb
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save st01c/b2d8db51103f717ff8f5 to your computer and use it in GitHub Desktop.

Select an option

Save st01c/b2d8db51103f717ff8f5 to your computer and use it in GitHub Desktop.
Sonic Pi 'spread' use
# forked from nicoder
# line 13 '?' asks for conditional and executes either first sample (true) or the one after ':' (false)
# problem with this formulation is that you can't specify sample parameters individually, just across the whole line
live_loop :takt do
sleep 0.5
end
live_loop :r do
sync :takt
with_fx :slicer, phase: 0.25, filter: 1, mix: 1 do
(spread 5, 12).each do |b|
sample b ? :drum_tom_mid_hard : :drum_cymbal_closed, amp: 0.5
sleep 0.25
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment