Skip to content

Instantly share code, notes, and snippets.

@AlexandreRangel
Created January 1, 2017 02:59
Show Gist options
  • Save AlexandreRangel/dbc2338f29439ca17fa33ec20fef3b0b to your computer and use it in GitHub Desktop.
Save AlexandreRangel/dbc2338f29439ca17fa33ec20fef3b0b to your computer and use it in GitHub Desktop.
Sonic Pi music code
# Alexandre rANGEL www.quasecinema.org
# i am the knight you are the pilgrim v05
# 31-Dec-2016
# Sonic Pi 2.11.1 www.sonic-pi.net
use_bpm 132
set_volume! 0.8
set_sched_ahead_time! 4
live_loop :clap do
with_fx :whammy, pitch: (ring 0,-8,0,-16,0,0).tick,
mix: rrand(0.2,0.8) do
with_fx :slicer, phase: 0.125/2 do
with_fx :echo, phase: 0.25, decay: 16 do
with_fx :flanger, phase: [0.125,0.25,0.5,1,2].choose,
mix: rrand(0.5,0.9) do
sample :drum_cymbal_soft, finish: 0.02,
amp: rrand(0.2,0.6) + 1,
pan: rrand(-0.3,0.3)
end
end
end
end
sleep 1
sleep 4 if one_in(4)
end
sleep 16
live_loop :notes1 do
use_synth :beep
with_fx :slicer, phase: 0.5 do
play [:e3,:g2,:e2,:e4].choose,
attack: 3, release: 3,
amp: rrand(1,1.3)+0.7, amp_slide: [1,2].choose,
pan: rrand(-0.2,0.2)
end
sleep 4
end
sleep 20
live_loop :kick1 do
x = tick
with_fx :flanger, phase: [0.1,0.2,0.25].choose,
mix: rrand(0.38,0.66) do
if one_in(72)
16.times do
sample :bd_boom, amp: rrand(2.2,2.4)+2,
rate: (ring 0.9,1)[x], finish: 0.4
sample :bd_ada, amp: rrand(0.3,0.4),
rate: (ring 0.8,1)[x]
sleep 1
end
else
sample :bd_ada, amp: rrand(2.2,2.4)-0.4,
rate: (ring 0.8,1)[x]
sleep 1
end
end
end
sleep 8
live_loop :notes2 do
with_bpm 132/[1,2,4].choose do
use_synth :mod_fm
with_fx :whammy, pitch: [-24,-16,-12,-8].choose,
mix: rrand(0.777,0.9) do
with_fx :flanger, phase: [16,8,4,2].choose,
mix: rrand(0.5,0.9) do
with_fx :echo, phase: 8,
reps: 2, decay: 16, mix: 0.333 do
with_fx :bitcrusher,
bits: [6,8,12,14].choose,
mix: rrand(0.2,0.444) do
with_fx :slicer, phase: 0.125, mix: 0.777 do
play scale([:e2,:e3,:g2,:g3].choose,:blues_minor).choose,
attack: 6, release: 6,
depth: [2,3,4,6,8,12,16].choose,
divisor: [2,3,4,6,8,12,16].choose,
amp: rrand(0.02,0.03)+0.4
end
end
end
end
end
sleep 8
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment