Created
April 18, 2015 14:59
-
-
Save danreedy/9348f84de788a1d91f01 to your computer and use it in GitHub Desktop.
OSCon in SonicPi
This file contains hidden or 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
# My attempt to recreate the OSCon Keynote "The Concert Programmer" | |
# by Andrew Sorensen using Sonic-Pi. | |
use_bpm 120 | |
use_synth :fm | |
$root = 52 | |
$key = :major | |
live_loop :metro do | |
sleep 1 | |
end | |
live_loop :left_hand do | |
sync :metro | |
with_fx :reverb do | |
play_pattern [55, 55, 57, 59], amp: 0.6, divisor: 1 | |
end | |
end | |
live_loop :root do | |
sync :metro | |
sleep 0.5 | |
play $root, amp: 0.5, divisor: 1 | |
end | |
live_loop :harmonic do | |
sync :metro | |
sleep 8 | |
$root = [52,50,48].reject { |i| i == $root }.sample | |
play $root, divisor: 1 | |
$key = [:major, :minor, :aeolian].sample | |
end | |
live_loop :right_hand do | |
sync :metro | |
with_synth :beep do | |
with_fx :reverb, amp: 0.8 do | |
play_pattern_timed scale($root+12, $key).shuffle, (dice > 2 ? 0.25 : [0.5, 0.25, 0.5, 0.25, 1].choose), release: 0.5 | |
end | |
end | |
end | |
live_loop :bass do | |
sync :metro | |
play_pattern_timed [$root, $root, $root], [1, 0.5, 1], divisor: 2, amp: 1, release: 0.25 | |
end | |
live_loop :kick do | |
sync :metro | |
2.times do | |
sample :drum_heavy_kick, amp: 0.3, release: 0.25 | |
end | |
end | |
live_loop :hats do | |
sync :metro | |
sample :drum_cymbal_closed, amp: 0.2 | |
if dice > 2 | |
sleep 0.5 | |
else | |
dice(4).times do | |
sleep 0.25 | |
sample :drum_cymbal_pedal, amp: 0.2 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment