Skip to content

Instantly share code, notes, and snippets.

@AlexandreRangel
Created January 14, 2018 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexandreRangel/06bb448b425c4d464cd253d26af6f815 to your computer and use it in GitHub Desktop.
Save AlexandreRangel/06bb448b425c4d464cd253d26af6f815 to your computer and use it in GitHub Desktop.
Sonic Pi music code
# alien youth orchestra v27
# Alexandre rANGEL
# www.quasecinema.org
# 14-Jan-2018 - Sonic Pi 3.01
use_bpm 144
gabi = '/Users/rng/Documents/WB-2018/week-02/gabi-linguas3.wav'
set_sched_ahead_time! 16
set_volume! 1.82
with_fx :echo, decay: 2 do
live_loop :gabi2 do
myBPM = (knit 36,1, 72,4, 144,6).choose
puts "bpm vox echo: #{myBPM} echo-echo-echo-echo"
with_bpm myBPM do
myRate = [rrand(0.4444,1),rrand(0.75,1),1].choose
myRate = -myRate if one_in(9)
myRate = -1 if one_in(12)
sample gabi, onset: rand_i(999),
amp: rrand(0.3,(ring 8,4,7,4,rrand(6,8),rrand(4,6)).tick),
rate: myRate
sleep [2,4,4,8,8].choose
end
end
end
sleep 4
x = 0
live_loop :euclid_beat do
# oh, the numbers and their chances
x = x + 1
puts "beat: #{x}"
if x < 48
myBPM = (knit 9,1, 18,3, 36,9, 72,7).choose
else
myBPM = (knit 36,4, 72,8, 144,13).choose
end
puts "bpm beat: #{myBPM} ---------------------"
with_bpm myBPM do
tick
with_fx :echo, phase: [0.125,0.25,rrand(0.1,0.2)].choose, reps: 2,
mix: (knit 0,15, 1,1, 0,16, 1,1, 0,4, 1,2, 0,6, 1,1, 0,6).look do
if (spread [7,7,9].choose, 11).look
mySnap = (knit :perc_snap,7, :perc_snap2,1, :misc_crow,1).look
with_fx :ixi_techno, res: rrand(0.3,0.7), phase: rrand(0.1,0.3), mix: 0.5 do
with_fx :slicer, phase: (knit 0.2,2, 0.1,14).look do
sample mySnap, amp: rrand(0.7,0.97) * 1.2, rate: rrand((ring 0.222,0.4444,0.6).look,1.03)
end
end
end
if (spread 1, (knit 16,8, 8,6, 4,32, 2,256, 4,8, 2,128).look).look
sample :bd_ada, rate: rrand(0.98,0.99), amp: rrand(1.3,1.55) *0.5
sample :bd_haus, rate: rrand(0.98,0.99), amp: rrand(1.3,1.55) *0.5 if one_in(2)
sample :bd_boom, rate: rrand(0.90,1.0), amp: rrand(1.3,2.55) *0.5 if one_in(4)
end
if (spread 1, 12).look
with_fx :flanger, phase: rrand(0.1,1.3), mix: rrand(0.3,0.7) do
sample :perc_bell, rate: [-0.6,rrand(-0.8,-0.4),0.6].choose,
amp: rrand(0,0.5)
end
end
end
myBong = (knit :elec_bong,22, :elec_filt_snare,2, :elec_bong,23, :ambi_glass_hum,1).look
sample myBong, amp: rrand(1.2,1.6), rate: rrand(0.8,1) if (spread 5, 8).look
if (spread 1, 24).look
with_fx :ring_mod, phase: [1,2,4,8,16,32,64].look, mix: [0,0.5,1].choose do
with_fx :flanger, phase: [2,4,8,8].choose, mix: 0.7 do
with_fx :flanger, phase: rrand(1,3), mix: 0.7 do
sample [:ambi_glass_rub,:ambi_glass_hum].choose,
rate: [rrand(-0.3,-0.75),rrand([0.4,0.9].choose,0.9)].choose,
amp: [0,rrand(0.6,1.6)].choose, amp_slide: [0.5,1,2,4,8].choose
end
end
end
end
sleep 0.25
if (spread 1, 4).look
with_fx :flanger, phase: rrand(0.5,2) do
with_fx :flanger, phase: rrand(1,2) do
sample :bd_fat, rate: rrand(0.111,0.333),
amp: rrand(4,5)
end
end
end
sleep 0.25
end
end
sleep 4
with_fx :reverb, mix: 0.4444 do
live_loop :gabi do
myBPM = (knit 9,1, 18,2, 36,3, 72,7, 144,9).choose
2.times do
puts "bpm vox: #{myBPM} vox-vox-vox-vox-vox"
with_bpm myBPM do
if one_in(2)
with_fx :echo, phase: [rrand(0.001,0.1),rrand(0.22,0.26)].choose,
mix: [0,0,0,0,rrand(0.1,0.4)].choose,
mix_slide: [0.25,0.5,1,2].choose do
sample gabi, onset: rand_i(9999),
amp: rrand(0,(ring 4,6,4,7).tick),
rate: [rrand(0.4444,1),rrand(0.75,1),1].choose
end
end
sleep [0.25,0.25,0.5,0.5,1].choose
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment