Skip to content

Instantly share code, notes, and snippets.

@nicoder
Created March 2, 2015 21:56
Show Gist options
  • Save nicoder/d6a9afb5ce5c785ace85 to your computer and use it in GitHub Desktop.
Save nicoder/d6a9afb5ce5c785ace85 to your computer and use it in GitHub Desktop.
20150302 sonic pi
use_bpm 120
define :bass_note do |n, s|
play n, attack: 0, sustain: s, release: 0.05, amp: 1
end
define :two_bass_notes do |n|
bass_note n, 0.1
sleep 0.25
bass_note n, 0.5
sleep 0.75
end
use_synth :fm
live_loop :bass do
[39, 41, 36, 36, 39, 38, 36, 36].each do |n|
4.times{two_bass_notes n}
end
end
live_loop :drums do
with_fx :lpf, cutoff: 90 do
sample :bd_sone, amp: 4
end
sleep 1
end
live_loop :notes do
with_fx :echo do
p = rrand(-1, 1)
play [60, 67].choose, amp: rrand(0.1, 0.2), pan: p
play [60, 79].choose, amp: rrand(0.1, 0.2), pan: p
play [60, 55].choose, amp: rrand(0.1, 0.2), pan: p
end
sleep 0.5
end
live_loop :snare do
sync :drums
with_fx :echo, phase: 2.5 do
with_fx :slicer, pulse_width: 0.125 do
sample :sn_dolf
end
end
sleep 4
end
live_loop :cym do
with_fx :echo, phase: 0.3, decay: 1.2 do
sample :drum_cymbal_pedal
end
sleep 2
end
live_loop :mel do
sync :drums
use_synth :mod_fm
play 60, release: 4, mod_range: [12, 24, 36].choose, amp: rrand(0.1, 0.2)
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment