Skip to content

Instantly share code, notes, and snippets.

@emlyn
Created October 9, 2015 11:50
Show Gist options
  • Save emlyn/325f8c1e050802272771 to your computer and use it in GitHub Desktop.
Save emlyn/325f8c1e050802272771 to your computer and use it in GitHub Desktop.
Sonic Pi
use_bpm 180
use_random_seed 42
live_loop :drum do
a,b = [[:Ab,:major], [:F, :minor], [:C, :minor], [:G, :minor]].choose
cue :key, a: a, b: b
if true then
with_fx :reverb do
4.times do
sample :drum_tom_mid_hard, amp: ring(4,2,3,2).tick
sleep 1
end
end
else
sleep 4
end
end
2.times do
sync :drum
end
live_loop :bass do
x = sync :key
c = chord(x[:a], x[:b])
uncomment do
with_synth :prophet do
with_transpose -24 do
with_synth_defaults cutoff: rrand(60, 90) do
4.times do
play c[0]
sleep 0.5
end
play c.choose
sleep 0.5
3.times do
play c[0]
sleep 0.5
end
end
end
end
end
end
2.times do
sync :bass
end
live_loop :one do
x = sync :key
c = chord(x[:a], x[:b])
uncomment do
with_synth :supersaw do
with_fx :ixi_techno, mix: 0.2, phase: rrand(3, 6), amp: 2 do
play c, sustain: rrand(3, 6)
end
end
end
end
3.times do
sync :one
end
live_loop :two do
x = sync :key
c = chord(x[:a], x[:b])
r = spread(dice(8), 8)
uncomment do
with_synth :piano do
with_transpose 12 do
with_fx :pan, amp: 2, pan: rrand(-1,1), pan_slide: rrand(1,4) do |fx|
8.times do
play c.choose if r.tick
control fx, pan: rrand(-1, 1)
sleep 0.5
end
end
end
end
end
end
@forksofpower
Copy link

This hurts me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment