Skip to content

Instantly share code, notes, and snippets.

@AlexandreRangel
Last active March 28, 2016 07:52
Show Gist options
  • Save AlexandreRangel/f8dbad0eefa06fa87f01 to your computer and use it in GitHub Desktop.
Save AlexandreRangel/f8dbad0eefa06fa87f01 to your computer and use it in GitHub Desktop.
# Alexandre rANGEL
# "ascension hill" (v14)
# www.quasecinema.org
# 26-Mar-2016
# Sonic Pi 2.9
myBPM = 144
bpmDivider = 2
use_bpm myBPM
set_volume! 1.0 # the age of
i1 = 0
i2 = 0
############################################################
live_loop :synth1 do
with_fx :normaliser, level: ring( 0,0.8,1,0.8)[tick(:synth1)] do
with_fx :reverb do
with_fx :slicer, phase: [2,0.25,0.5,1].choose do
with_bpm myBPM / [2,3,3,3,4].choose do
with_fx :normaliser, level: [0.222,0.333,0.444].choose do
with_fx :echo, phase: [2,4,8,16].choose do
with_fx :slicer, phase: [0.25,0.5,1,2].choose do
with_fx :gverb, room: rrand(30,77), spread: rrand(0.5,0.99) do
with_fx [:flanger,:ixi_techno,:krush].choose,
phase: [4,2,0.5,1].choose do
with_fx [:panslicer,:flanger,:ixi_techno].choose,
phase: [0.5,1,2].choose do
with_fx :echo do
with_fx :distortion, distort: 0.9, mix: 0.66 do
i1 = i1 + 0.1
r = (120.0 / ring( 2.0,1.0,0.5)[i1.to_int])
with_bpm r do
([0,2,4,8].choose).times do
use_synth [:blade,:prophet,:pulse].choose
play scale(:c2, :minor, num_octaves: [3,2,1].choose).choose,
release: [4,8,16].choose/2,
amp: rrand(1.03,1.11)*0.02, pan: 0.5
sleep 1.0/3
play scale(:g2, :minor, num_octaves: [1,2,3].choose).choose,
release: [4,8,16].choose,
amp: rrand(1.03,1.10)*0.02, pan: -0.5 if one_in([2,3,5].choose)
sleep 4 / [1,2].choose
end # times
([0,2,4,8].choose).times do
use_synth [:prophet,:blade,:fm,:beep].choose
play scale(:g1, [:mixolydian,:major_pentatonic].choose, num_octaves: [7,1,2,3].choose).choose,
release: [4,8,16].choose/2,
amp: rrand(0.03,0.10)*0.02, pan: -0.5
sleep 1.0/3
play scale(:c2, :major, num_octaves: [3,2,1].choose).choose,
release: [4,8,16].choose,
amp: rrand(0.03,1.17)*0.02, pan: 0.5 if one_in([3,2,1,7,9].choose)
sleep 4 / [1,2].choose
end #times
end #bpm
end #distortion
end #flanger
end #slicer
end #echo
end #echo
end #gverb
end #echo
end #normaliser
sleep 4
end #bpm
end #slicer
end #reverb
end #level
end #synth
######################################################################
live_loop :synth2 do # ambience
with_bpm myBPM / 4 do
use_synth [:pnoise, :hollow].choose
if one_in(2)
with_fx :pitch_shift, pitch: [0,-2,-4,-6].choose,
window_size: ring( 0.001,0.002,0.003,0.004)[tick(:synth2a)] do
play (:c3), amp: 0.45,
attack: [2,4,8,16].choose, release: [4,8,16].choose
end
else
with_fx :pitch_shift, pitch: [0,-8,-16].choose,
window_size: ring( 0.01,0.02,0.03,0.04)[tick(:synth2b)] do
play (:g2), amp: 0.45,
attack: [2,4,8,16].choose, release: [4,8,16].choose
end
end
sleep [1,2,2,2,4,4,8,8,16,32,64].choose
end #bpm
end
######################################################################
live_loop :drums1 do
with_bpm myBPM / bpmDivider do
#with_fx :slicer, phase: do
# pan: +1
i2 = i2 + (1.0/13.0)
i2int = quantise(i2,1)
with_fx :slicer, phase: ring( 0.1,0.2,0.25,0.5,1) [i2int] do
#with_fx :echo,
#phase: [0.1,1.0/8,0.25,0.25,1.0/3,0.5].choose do
with_fx :flanger, phase: [0.25,1.0/3,0.5,1,2,3,4].choose do
sample '/Users/rangel/pisamples/clap909.wav',
rate: rrand(0.7,1.2), pan: rrand(-0.05,0.05),
amp: rrand(0.10,0.13) * 2.5
sleep ring( 0.25,0.5,1.0)[rand_i(100)] #im all over the place
end
#end
end
end #bpm
end
######################################################################
live_loop :drums2 do
with_bpm myBPM / bpmDivider do
20.times do
sample '/Users/rangel/pisamples/clap909.wav',
pan: rrand(-0.07,0.13),
amp: rrand(0.22,0.26)*1.15, rate: 1.5
sleep 1.0/4 *2
end
8.times do
sample '/Users/rangel/pisamples/clap909.wav',
pan: rrand(-0.07,0.13),
amp: rrand(0.24,0.28)*1.2, rate: 1.75
sleep 1.0/4 *2
end
8.times do
sample '/Users/rangel/pisamples/clap909.wav',
pan: rrand(-0.07,0.13),
amp: rrand(0.23,0.29)*1.3, rate: 2.0
sleep 1.0/4 *2
end
end
end
######################################################################
sleep 16
######################################################################
live_loop :drums3 do
with_fx :compressor, slope_below: 1.333, slope_above: 1.0,
mix: rrand(0.8,1.0) do
with_fx :gverb, mix: rrand(0.17,0.27) do
sample :bd_ada, amp: rrand(1.213,1.53) * 2.1 *0.6
sleep 1
sample :bd_ada, amp: rrand(1.213,1.53) * 1.7 *1.1 *0.6
sleep 2
sample :bd_fat, amp: rrand(1.213,1.53) * 2.1 *0.6
sleep 1
sample :bd_ada, amp: rrand(1.213,1.53) * 1.8 *1.1 *0.6
sleep [0.5,1].choose
end #fx
with_fx :gverb, mix: rrand(0.33,0.4) do
sample :bd_fat, amp: rrand(1.213,1.53) * 2.1 *0.6
sleep 1
sample :bd_ada, amp: rrand(1.213,1.53) * 1.7 *1.1 *0.6
sleep [0.5,1].choose
sample :bd_fat, amp: rrand(1.213,1.53) * 2.1 *0.6
sleep 1
sample :bd_ada, amp: rrand(1.213,1.53) * 1.8 *1.1 *0.6
sleep [0.5,1].choose
end #fx
end #fx
sleep 4 if one_in(16)
end
######################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment