Skip to content

Instantly share code, notes, and snippets.

@hamin
Last active October 26, 2019 08:50
Show Gist options
  • Save hamin/1d3f45623b38504d72c8 to your computer and use it in GitHub Desktop.
Save hamin/1d3f45623b38504d72c8 to your computer and use it in GitHub Desktop.
Arcade Fire's 'The Suburbs' in Sonic PI ;) Download http://sonic-pi.net and copy paste this Grammy Winning gem ;)
in_thread do
loop do
sample :drum_bass_hard, amp: 2
sleep 2
end
end
in_thread do
loop do
sleep 1
sample :drum_snare_hard, amp: 2
sleep 1
end
end
in_thread do
loop do
sample :drum_cymbal_pedal, amp: 1
sleep 0.5
end
end
in_thread do
loop do
cue :tick
#synth = [:pulse, :fm, :tb303].sample
use_synth :fm
4.times do
play chord(:D4, :major)
sleep 0.5
end
4.times do
play chord(:B4, :minor)
sleep 0.5
end
4.times do
play chord(:Gb4, :major)
sleep 0.5
end
4.times do
play chord(:A4, :major)
sleep 0.5
end
end
end
in_thread do
loop do
sync :tick
play_pattern_timed chord(:D4, :major), [0.25, 4], pan: -1
play_pattern_timed chord(:B4, :minor), [0.25, 4], pan: 1
play_pattern_timed chord(:Gb4, :major), [0.25, 4], pan: -1
play_pattern_timed chord(:A4, :major), [0.25, 4], pan: 1
end
end
riff1 = lambda do
sleep 0.5
play :Gb6
sleep 0.25
play :Gb6
sleep 0.25
play :A6
sleep 0.35
play :B6
sleep 0.5
play :Gb6
end
riff2 = lambda do
sleep 2.65
play :Gb6
sleep 0.5
play :E6
sleep 0.5
play :Db6
sleep 0.25
play :E6
end
riff3 = lambda do
sleep 1.75
play :Db6
sleep 0.35
play :Db6
sleep 0.5
play :Db6
sleep 0.25
play :B5
sleep 0.5
play :A5
sleep 0.25
play :B5
sleep 0.25
play :Db6
sleep 0.25
play :Db6
end
verse = lambda do
[riff1, riff2, riff3, riff2, riff3, riff2].map(&:call)
end
chorus_riff1 = lambda do
sleep 0.5
play :Db7
sleep 0.5
play :B6
sleep 0.5
play :A6
sleep 0.5
play :Ab6
sleep 0.85
play :Db6
sleep 0.15
play :E6
sleep 0.35
play :Gb6
end
chorus_riff2 = lambda do
sleep 1.1
play :Gb6
sleep 0.5
play :E6
sleep 0.5
play :D6
sleep 0.5
play :Db6
sleep 0.85
play :D6
sleep 0.15
play :Db6
sleep 0.35
play :A5
end
chorus = lambda do
sample :drum_splash_soft, amp: 2
[chorus_riff1, chorus_riff2].map(&:call)
sample :drum_splash_soft, amp: 2
end
verse.call
sleep 2.25
in_thread do
loop do
sample :drum_cymbal_soft, amp: 2
sleep 0.5
end
end
chorus.call
sleep 0.7
chorus.call
@hamin
Copy link
Author

hamin commented Mar 11, 2015

definitely some timing/rest issues in the chorus melody...but fun stuff :)

@hamin
Copy link
Author

hamin commented Aug 21, 2015

Think I fixed the timing issues

@samaaron
Copy link

Wicked! One quick tip - you'll definitely benefit from reading the help sections on live_loop and live coding in general :)

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