Last active
April 20, 2018 16:40
-
-
Save mgandin/15a38f4f6af4a200b9488b560526ca7c to your computer and use it in GitHub Desktop.
Sonic Pi Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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