Skip to content

Instantly share code, notes, and snippets.

@AlexandreRangel
Created October 9, 2016 23:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AlexandreRangel/afe7728dc3cffbceca78219f41c28638 to your computer and use it in GitHub Desktop.
Save AlexandreRangel/afe7728dc3cffbceca78219f41c28638 to your computer and use it in GitHub Desktop.
Sonic Pi music code
# Alexandre rANGEL www.quasecinema.org
# born out of concrete v03
# 9/Oct/2016
# Sonic Pi 2.11 dev
use_bpm 120
live_loop :notes1 do
with_bpm 240 do
x = tick
use_synth :blade
with_fx :panslicer, phase: [0.5,1].choose do
with_fx :echo, phase: 1, decay: 3 do
with_fx :slicer, phase: 0.5 do
play [scale(:c5,:chinese).tick,scale(:c5,:chinese).choose].choose,
sustain: [2,4,4,8,8,16].choose,
amp: (ring 0,0,1.5,1.2,1.5,9,0,0,0,1.2,1.5,0,0,0)[x],
amp_slide: 2
end
end
end
sleep [3,6].choose
sleep 3 if one_in(4)
end
end
live_loop :notes2 do
with_bpm 240 do
x = tick
use_synth :fm
with_fx :pitch_shift, pitch: [-6,-12,-12,-18].choose, window_size: rrand(0.0001,[0.001,0.1].choose) do
4.times do
with_fx :slicer, phase: [0.25,0.5,0.5,0.5].choose do
with_fx :flanger, phase: [2,4,8,12].choose,
depth: 8, feedback: 1, mix: rrand(0,1) do
with_fx :echo, phase: 2, decay: 4 do
with_fx :reverb, mix: rrand(0.1,0.4444) do
with_fx :echo, phase: 0.2, decay: 2 do
with_fx :slicer, phase: 0.5 do
play [scale([:c3,:e3].choose,:gong).tick,scale([:c3,:f3].choose,:gong).choose].choose,
sustain: [0.25,0.1].choose,
divisor: [0.5,1,2].choose, depth: [0.5,1,2,4,8,16,32,64].choose,
amp: (ring 0,0,1.8,2.2,0,0,1.8,2.2,0,0,1.8,2.4)[x],
amp_slide: 0.5
end
end
end
end
end
end
sleep [0.5,1].choose
end
end
sleep [6,8,12].choose
end
end
live_loop :drums1 do
with_fx :echo, phase: 1, decay: 3 do
sample :tabla_ghe3, amp: ((ring 1.1,1.5).tick) * 1.1
end
sleep 4
end
live_loop :drums2 do
x = tick
with_fx :echo, phase: 1.0/4, decay: (ring 1,2)[x] do
sample :tabla_re, amp: (ring 1.1,1.5)[x]
end
sleep (ring 2,1)[x/4]
end
live_loop :kick do
x = tick
sample :bd_808, amp: (ring 2,2.4)[x]
sample :bd_haus, amp: (ring 1.8,2)[x] + rand(0.2)
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment