Last active
June 10, 2017 04:07
-
-
Save AlexandreRangel/06286e311a66ef4201ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alexandre rANGEL | |
# 'atomic garden of gravitational waves' (v10) | |
# https://www.youtube.com/watch?v=BEyHi5LkQWk | |
# www.quasecinema.org | |
# 14-Feb-2016 | |
# Sonic Pi 2.12 | |
mybpm = 66 #* 6 | |
use_bpm mybpm | |
startClock = 0 # 0 to start song at beginning | |
clock = startClock # global var | |
bar = 0 # global var | |
set_volume! 0.8 | |
t = Time.new | |
x = (t.year - t.month - t.day - t.hour - t.min - t.sec) | |
puts "x = #{x}" #1951 | |
use_random_seed = 1951 #x | |
# http://www.freesound.org/people/Digitopia_CdM/sounds/261681 | |
# download sample and rename to gamelan.wav | |
# put it in your path, defined here: | |
sampleGamelan = '/Users/rangel/Documents/SamplesPi/gamelan.wav' | |
load_sample sampleGamelan | |
############################################################# | |
# use_synth :beep # countdown sync | |
# play 90, attack: 0, sustain: 1, release: 0, amp: 2 | |
# sleep 2 | |
# play 90, attack: 0, sustain: 1, release: 0, amp: 2 | |
# sleep 2 | |
# play 90, attack: 0, sustain: 1, release: 0, amp: 2 | |
# sleep 4 | |
############################################################# | |
live_loop :metro do | |
cue :metro | |
sleep 0.5 | |
clock = startClock + tick | |
bar = clock / 4 | |
puts "let's go!" if clock < 1 | |
puts "bar : #{bar}, bpm: #{mybpm}" | |
puts (ring "1 !","2 ! !","3 ! ! !","4 ! ! ! !")[clock] | |
end #metro | |
############################################################# | |
with_fx :compressor, slope_below: 1.66, slope_above: 0.95 do | |
############################################################# | |
live_loop :gamelan do | |
with_fx :pitch_shift, pitch: ([-16,-12,-8,-6,-4].choose + 16), | |
window_size: rrand(0.0001,0.001) do | |
sample sampleGamelan, | |
rate: (ring 1,1,1,-1,0.5,0.5,0.9,-0.85)[tick], | |
pan: rrand(-0.33,0.33), pan_slide: rrand(0.02,0.8), | |
amp: (ring 19,5,7,5,7,5,7,5)[tick] * 0.77 * 1.3 | |
end | |
with_fx :pitch_shift, pitch: [-18,-14,-10,-8,-6].choose, | |
window_size: rrand(0.0001,0.001) do | |
sample sampleGamelan, | |
rate: (ring 1,1,1,-1,0.5,0.5,0.9,-0.85)[tick] * 0.75, | |
pan: rrand(-0.6,0.6), pan_slide: rrand(0.02,0.8), | |
amp: (ring 18,5,7,5,7,5,7,5)[tick] * 0.69 * 1.3 | |
end | |
with_fx :pitch_shift, pitch: [-20,-16,-12,-10,-8].choose, | |
window_size: rrand(0.0001,0.001) do | |
sample sampleGamelan, | |
rate: (ring 1,1,1,-1,0.5,0.5,0.9,-0.85)[tick] * 0.666, | |
pan: rrand(-0.2,0.2), pan_slide: rrand(0.4,0.8), | |
amp: (ring 20,5,7,5,7,5,7,5)[tick] * 0.77 * 1.3 | |
end | |
sleep (ring 12,12,8,24)[tick] | |
end | |
sleep 3 | |
############################################################# | |
live_loop :notes do | |
if rand(100) > [12,24,36,48].choose | |
x = rand_i(6) | |
rand_note1 = (ring :a2,:b2,:c2,:d2,:e2,:f2,:g2)[tick+x] | |
rand_note2 = (ring :a2,:b2,:c2,:d2,:e2,:f2,:g2)[tick+x+3] | |
rand_note3 = (ring :a2,:b2,:c2,:d2,:e2,:f2,:g2)[tick+x+5] | |
#rrand(note(:A2), note(:A4)) | |
with_fx :slicer, phase: (ring 32,16,8,16,4,16,2)[tick/2], | |
smooth_up: (ring 0.1,1,0.05,0.08,0,0,0.02)[tick/2], | |
smooth_down: (ring 0.2,0.2,0.2,0.2,0,0,0.05)[tick/2] do | |
with_fx :echo, phase: [4,8,8].choose do | |
with_fx :pitch_shift, pitch: [-8,-8,8].choose, pitch_dis: 0.2, mix: 0.66, | |
window_size: 0.001 do | |
with_fx :pitch_shift, pitch: [-8,8,8].choose, pitch_dis: 0.5, mix: 0.66, | |
window_size: 0.001 do | |
with_fx :pitch_shift, pitch: [-6,-12].choose, | |
window_size: rrand(0.0001,0.001) do | |
use_synth :dsaw | |
play rand_note1, detune: rrand(0,1), | |
pitch_shift: [-4,-6,-8,-12].choose, | |
window_size: rrand(0.0001,0.001), | |
detune_slide: 4, | |
attack: 3, sustain: 2, release: 2, | |
pan: rrand(-0.53,0.53), | |
note_slide: 2, | |
amp: 0.55 | |
with_fx :pitch_shift, pitch: [-12,-16,-18,-24,-36].choose, | |
window_size: rrand(0.0001,0.001) do | |
use_synth :prophet | |
play rand_note2, detune: rrand(0,1), | |
detune_slide: 4, | |
attack: 2, sustain: 3, release: 3, | |
pan: rrand(-0.54,0.54), | |
note_slide: 2, | |
amp: rrand(0.5,0.7) * 0.55 | |
end #:pitch_shift | |
with_fx :krush, cutoff: rrand(0,131) do | |
with_fx :pitch_shift, pitch: [-18,-24,-36].choose, | |
window_size: rrand(0.0001,0.0005) do | |
with_fx :krush, cutoff: rrand(1,64), mix: 0.5 do | |
use_synth :mod_pulse | |
play rand_note3, detune: rrand(0,1), | |
detune_slide: 4, | |
attack: 4, sustain: 1, release: 4, | |
pan: rrand(-0.5,0.5), | |
note_slide: 2, | |
amp: rrand(0.5,0.8) * 0.55 | |
end #:krush | |
end #:pitch_shift | |
end #:krush | |
end #:pitch_shift | |
end #:pitch_shift | |
end #:pitch_shift | |
end #:echo | |
end #:slicer | |
end #if | |
sleep 8 | |
end #:live_loop | |
############################################################## | |
live_loop :synth1 do | |
with_fx :compressor, slope_below: 1.5, slope_above: 1.5, mix: 0.5 do | |
with_fx :echo, delay: [3,6].choose, phase: rrand(0.6,0.8), | |
pre_amp: 1.33, mix: rrand(0.7,1.0) do | |
with_fx :distortion, distort: rrand(0.4,0.6), mix: rrand(0.8,1.0) do | |
use_synth :supersaw | |
play [:c1,:c2,:c2,:c2].choose, | |
amp: 0.333 *1.1 | |
sleep [2,2,2,2,2,2,2,2,2,3].choose | |
end | |
end | |
end | |
end | |
############################################################## | |
live_loop :drums1 do | |
sample :bd_haus, amp: rrand(0.69,0.76) * 1.5 | |
sleep 0.5 | |
end | |
############################################################## | |
live_loop :drums2 do | |
with_fx :echo, phase: 0.25, mix: 0.8 do | |
with_fx :hpf do | |
with_fx :bitcrusher, bits: (ring 7,9,7,9, 7,5,7,5)[tick/2] do | |
sample :drum_snare_soft, | |
amp: rrand(5,7) * 0.74 | |
end | |
end | |
end | |
sleep 0.5 | |
end | |
############################################################## | |
live_loop :drums3 do | |
with_fx :echo, phase: 0.3333, mix: [0.6,0.8].choose do | |
with_fx :hpf, cutoff: 30 do | |
sample :drum_tom_mid_soft, | |
amp: rrand(0.9,0.95) * 1.83 | |
end | |
end | |
sleep [0.333,0.333,0.333,0.333,0.5,0.5,0.5,0.5,1,4].choose | |
end | |
############################################################## | |
live_loop :drums4 do | |
with_fx :echo, phase: [1,2,3,4].choose, mix: 0.5 do | |
with_fx :wobble, res: rrand(0.1,0.9) do | |
sample :drum_bass_hard , rate: [0.6,0.7].choose, | |
amp: rrand(0.7,0.8) * 1.55 | |
sleep 2 | |
end | |
end | |
end | |
############################################################## | |
end #:compressor | |
############################################################## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment