Skip to content

Instantly share code, notes, and snippets.

@AlexandreRangel
Created December 24, 2018 22:10
Show Gist options
  • Save AlexandreRangel/a76dcf1db6ab30c0d1347a6f8bdd54e0 to your computer and use it in GitHub Desktop.
Save AlexandreRangel/a76dcf1db6ab30c0d1347a6f8bdd54e0 to your computer and use it in GitHub Desktop.
Sonic Pi music code
#are shadows faster than the light?
#Sonic Pi 2.11
#satelites 18
#sounds from other dimensions
#are shadows faster than the light?
#we are moving so fast through space
#are are we leaving behind?
#do you hear the footsteps?
dir = '/Users/rangel/Documents/SamplesPi/sat'
set_sched_ahead_time! 2
use_random_seed Time.new.usec #135001
puts Time.new.usec
set_volume! 0.6
use_bpm 14
live_loop :drums do
sleep 0.05
x = tick
sample :bd_klub, amp: ring(7,0,5,0)[x]
sample :bd_fat, amp: ring(0,0,0,0, 5,0,3,0)[x]
sample :drum_snare_soft, amp: ring(0,0,0,0, 2,0,0,0, 0,0,0,0, 1,0,0,0)[x] #sr
#sample :drum_snare_soft, amp: ring(0,1,0,0, 0,1,0,1, 0,1,0,0, 0,1,1,1)[x], pan: -1 #oh
#sample :drum_cymbal_pedal,amp: ring(0,0,0,0, 0,0,0,0, 1,0,1,1, 0,1,0,1)[x] #cp
end
with_fx :compressor, slope_below: 0.5, slope_above: 0.3, threshold: 0.6 do
with_fx :slicer, phase: 0.25/2, smooth_down: 0.25, mix: 0.7 do
with_fx :pitch_shift, pitch: -6, pitch_slide: 0.5, window_size: 0.001, mix: 0.555 do
with_fx :flanger, phase: 48, phase_offset: 0.5, mix: 0.6 do
with_fx :ixi_techno, phase: 56, mix: 0.5 do
with_fx :flanger, phase: 16, mix: 0.4 do
with_fx :ixi_techno, phase: 24, mix: 0.4 do
with_fx :echo, phase: 0.2, mix: 0.4444 do
live_loop :satelites1 do
with_bpm [7,14,35,70,140,280,350,700,1400].choose do
x1 = rrand_i(1,96); y1 = dir, x1
with_fx :pitch_shift, pitch: (ring 2,4,2,0,0,-2).tick do
with_fx :octaver, subsub_amp: [0,1.4].choose,
subsub_amp_slide: [0.5,1,2].choose, mix: 0.333 do
with_fx :pitch_shift,
pitch: [6,12,18].choose, pitch_slide: 2,
window_size: rrand(0.0001,0.001) do
rate1 = rrand(0.2,0.3)
sample y1, rate: rate1, amp: rrand(1,3),
pan: [-0.75,0.75].choose, pan_slide: 2,
attack: 1, release: 1
end
end
end
sleep (sample_duration y1) * 0.25
sleep (sample_duration y1) * 0.5 if one_in(3)
end
end
sleep 2
live_loop :satelites2 do
with_bpm [7,14,35,70,140,280,350,700,1400].choose do
x2 = rrand_i(0,97); y2 = dir, x2
with_fx :pitch_shift, pitch: (ring 0,-4,0,-2,-2,-5).tick do
with_fx :octaver, subsub_amp: [0,1.4].choose,
subsub_amp_slide: [0.5,1,2].choose, mix: 0.333 do
with_fx :pitch_shift,
pitch: [6,12,18].choose,
pitch_slide: [1,2,4].choose,
window_size: rrand(0.0001,0.001) do
rate2 = rrand(0.2,0.3)
sample y2, rate: rate2, amp: rrand(1,3),
pan: [-0.75,0.75].choose, pan_slide: 2,
attack: 2, release: 2
end
end
end
sleep sample_duration y2, rate: 0.25
sleep (sample_duration y2) * 0.5 if one_in(3)
end
end
sleep 2
live_loop :satelites3 do
with_bpm [7,14,35,70,140,280,350,700,1400].choose do
x3 = rrand_i(1,98); y3 = dir, x3
with_fx :octaver, super_amp: [0,1.4,2.8].choose,
super_amp_slide: [0.5,1,2].choose, mix: 0.333 do
with_fx :pitch_shift,
pitch: [6,12,18].choose,
pitch_slide: [1,2,4].choose,
window_size: rrand(0.0001,0.001) do
sample y3, rate: rrand(0.9,1.03), amp: rrand(0.5,2.4),
attack: 1, release: 1,
pan: (ring -0.88,0.88).tick, pan_slide: 2
end
end
sleep sample_duration y3, rate: rrand(0.9,1)
sleep sample_duration y3, rate: rrand(0.9,1) if one_in(3)
end
end
sleep 2
live_loop :satelites4 do
with_bpm [7,14,35,70,140,280,350,700,1400].choose do
x4 = rrand_i(2,98); y4 = dir, x4
with_fx :octaver, super_amp: [0,1.4,2.8].choose,
super_amp_slide: [0.5,1,2].choose, mix: 0.333 do
with_fx :pitch_shift,
pitch: [6,12,18].choose,
pitch_slide: [1,2,4].choose,
window_size: rrand(0.0001,0.001) do
sample y4, rate: rrand(0.9,1.05), amp: rrand(0.5,2.4),
attack: 1, release: 1,
pan: (ring -0.88,0.88).tick, pan_slide: 4
end
end
sleep sample_duration y4, rate: rrand(0.9,1)
sleep sample_duration y4, rate: rrand(0.9,1) if one_in(3)
end
end
end
end
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment