Skip to content

Instantly share code, notes, and snippets.

@mgandin
Last active April 20, 2018 16:40
Show Gist options
  • Save mgandin/15a38f4f6af4a200b9488b560526ca7c to your computer and use it in GitHub Desktop.
Save mgandin/15a38f4f6af4a200b9488b560526ca7c to your computer and use it in GitHub Desktop.
Sonic Pi Example
use_synth :blade
bizet = (ring :d, :r, :r, :a, :f5, :r, :a, :r)
bizet_variation = (ring :d, :r, :r, :Bb, :g5, :r, :Bb, :r)
define :drums do
2.times do
if rand(2) > 1
sample :drum_tom_mid_soft
else
sample :drum_heavy_kick
end
sleep 0.250
end
end
live_loop :beats do
sync :melody
drums
end
with_fx :reverb, room: 1 do
live_loop :melody do
tick
if rand(2) > 1
play bizet .look, release: 0.3
else
play bizet_variation .look, release: 0.3
end
sleep 0.125
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment