Skip to content

Instantly share code, notes, and snippets.

@zgulde
Created December 10, 2015 20:14
Show Gist options
  • Save zgulde/754d428d9612fa95fba0 to your computer and use it in GitHub Desktop.
Save zgulde/754d428d9612fa95fba0 to your computer and use it in GitHub Desktop.
playing with sonic pi
arpeggios =
[
[:A3, :C4, :E4, :A4],
[:C4, :E4, :G4, :A4, :B4, :C5],
[:A3, :C4, :E4, :A4, :C5, :E5, :A5, :E5, :C5, :A4, :E4, :C4],
[:A5, :E5, :C5, :A4, :E5, :C5, :A4, :E4, :C5, :A4, :E4, :C4],
[:A3, :C4, :E4, :C4, :E4, :A4, :E4, :A4, :C5, :A4, :C5, :E5, :C5, :E5],
[:A4, :B4, :C5, :B4, :C5, :D5, :C5, :D5, :E5],
[:A5, :G5, :E5, :G5, :E5, :D5, :E5, :D5, :C5]
]
synths = [:fm, :blade, :square, :saw, :sine, :piano]
arptime = 2.0
arp = []
sleepTime = 0;
live_loop :me do
arp = arpeggios.sample
sleepTime = arptime/arp.length
use_synth synths.sample
4.times do
arp.each_with_index do |note, index|
case (index+1) % 4
when 1
sample :drum_bass_hard
sample :drum_cymbal_soft
when 2
sample :drum_cymbal_closed
when 3
sample :drum_snare_hard
sample :drum_cymbal_closed
when 0
sample :drum_cymbal_closed
end
play note
sleep sleepTime
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment