Last active
June 12, 2016 23:39
-
-
Save AlexandreRangel/bf41c89d2c96b2058c33170e2085f2bf to your computer and use it in GitHub Desktop.
Sonic Pi music code
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 "what's this flux of thoughts I call I?" v16 | |
# www.quasecinema.org | |
# 12 June 2016 / Sonic Pi 2.10 | |
set_volume! 0.8 | |
use_bpm 600 | |
clock = 0 | |
sample_metalhit = '/Users/rangel/pisamples/metalhit.wav' #http://www.freesound.org/people/niqoplitnouk/sounds/220063/ | |
sample_triangle = '/Users/rangel/pisamples/triangle.wav' #http://www.freesound.org/people/nicolasdrweski/sounds/179625/ | |
set_sched_ahead_time! 2 | |
######################################################################## | |
live_loop :metro do | |
clock = tick | |
bar = clock / 4 | |
puts "bar : #{bar}" | |
puts (ring "1 |","2 | |","3 | | |","4 | | | |")[clock] | |
set_mixer_control! lpf: [rrand(100,108),rrand(108,116)].choose, lpf_slide: [2,4,8,16,32].choose if one_in(64*4) | |
set_mixer_control! hpf: 0, lpf_slide: [4,8,16,32].choose if one_in(32*4) | |
set_mixer_control! hpf: 90, hpf_slide: [8,16,32].choose if one_in(256*4) | |
sleep 1 | |
end #metro | |
######################################################################## | |
live_loop :texture1 do | |
with_bpm 12 do | |
with_fx :flanger, phase: [1,2,4,8,16].choose, mix: rrand(0.2,0.5) do | |
use_synth :growl | |
play scale(:g2, :egyptian).choose, | |
res: rrand(0.3,0.8), res_slide: [0.5,1,2,4].choose, | |
pan: rrand(-0.8,0.8), pan_slide: [1,2,3,6].choose, | |
attack: [2,4,8.16].choose, sustain: 2, release: 8, | |
amp: rrand(1,5) *0.7 *0.2 | |
sleep 2 | |
use_synth :fm | |
play chord(scale(:g2, :egyptian).choose,:major), | |
res: rrand(0.2,0.77), res_slide: [0.5,1,2,4,8].choose, | |
divisor: [[2,4].choose,rrand(0,4)].choose, | |
divisor_slide: 4, | |
attack: [2,4,8,].choose, sustain: 2, | |
release: [8,8,8,16].choose, | |
amp: rrand(1,5.1) *0.7 *0.2 | |
sleep 2 | |
play scale(:g3, :egyptian).choose, | |
res: rrand(0.2,0.71), res_slide: [0.5,1,2,4,8].choose, | |
divisor: [[2,4,8,12,16].choose,rrand(0,4)].choose, | |
divisor_slide: 4, | |
attack: [2,4].choose, sustain: 2, release: [6,8,12,16].choose, | |
pan: rrand(-0.6,0.6), pan_slide: [1,2,3,6,12].choose, | |
divisor_slide: 4, amp: rrand(1,4) *0.7 *0.2 | |
sleep 8 | |
end | |
end | |
end | |
######################################################################## | |
with_fx :slicer, phase: 0.5, smooth: 0.01, mix: 0.7 do | |
with_fx :compressor, threshold: 0.7, | |
slope_above: 0.7, slope_below: 1.05, mix: 0.6 do | |
######################################################################## | |
live_loop :linger do | |
cue :metro | |
myAmp = rrand(0.75,0.9) *1.5 | |
with_fx :compressor, mix: 0.7 do | |
with_fx :panslicer, phase: [0.5,1,2,4,8,16].choose, | |
smooth: [1,2,4,8].choose do | |
with_fx :pitch_shift, pitch: rrand(-8,0), | |
window_size: rrand(0.001,0.01) do | |
with_fx :pitch_shift, pitch: [-8,-12,-16].choose, | |
window_size: rrand(0.01,0.1) do | |
with_fx :ixi_techno, res: rrand(0.01,0.8), | |
mix: rrand(0.001,0.7) do | |
use_synth :blade | |
ata = 0.01 | |
rel = rrand(1.7,2.1) * 2.2 | |
dif = rrand(0.01,0.08) | |
p = rrand(-0.4,0.4) #pan | |
ps = [4,8].choose #pan slide | |
play 60, attack: ata, release: rel + dif, amp: myAmp | |
sleep 0.02 | |
play rrand_i(62,63), attack: ata, release: rel, amp: myAmp | |
sleep 0.02 | |
play 67, attack: ata, release: rel, amp: myAmp | |
play 60, attack: ata*2, release: (rel + dif)*1.8, | |
detune: [6,12,18].choose, | |
pan: p, pan_slide: ps, | |
amp: myAmp/3.5 | |
sleep 0.02 | |
play rrand_i(62,63), attack: ata*2, release: (rel + dif)*1.8, | |
detune: [6,12,18].choose, | |
pan: p, pan_slide: ps, | |
amp: myAmp/3.5 | |
sleep 0.02 | |
play 67, attack: ata*2, release: (rel + dif)*1.8, | |
detune: [6,12,18].choose, | |
pan: p, pan_slide: ps, | |
amp: myAmp/3.5 | |
sleep ( 8 - dif - dif) | |
end #fx | |
end #fx | |
end #fx | |
end | |
end | |
end #linger | |
######################################################################## | |
sleep 60 | |
######################################################################## | |
live_loop :tum do | |
with_bpm 600 / [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,4,8].choose do | |
with_fx :echo, reps: 2, phase: [rrand(0.001,0.03),0.5].choose, | |
mix: rrand(0.1,0.5) do | |
with_fx :krush, gain: rrand(1.2,2.5), mix: rrand(0.01,0.2) do | |
sample :drum_bass_hard, amp: rrand(0.5,0.7) *1.1 | |
sleep 2 | |
sample :drum_bass_soft, amp: rrand(0.7,1.1) *rrand(1.1,1.3) | |
sleep 1 | |
sample :drum_bass_hard, amp: rrand(0.7,1.1) *1.1 | |
sleep 1 | |
end | |
end | |
end | |
end #tum | |
######################################################################## | |
sleep 120 | |
######################################################################## | |
sleep 0.5 | |
live_loop :tss do | |
with_fx :panslicer, phase: [1,2,4,8].choose, smooth: [1,2,4,8].choose do | |
with_fx :pitch_shift, pitch: rrand(-8,0), window_size: rrand(0.001,0.01) do | |
with_fx :echo, reps: 2, decay: 4, | |
phase: [rrand(0.001,0.03),0.5,3].choose, mix: rrand(0.1,0.222) do | |
use_synth :pluck | |
play 60, attack: 0.01, sustain: 0, release: [4,6].choose, | |
amp: rrand(0.6,0.7) if one_in(20) | |
sleep [2,4].choose | |
sleep 8 if one_in(72) | |
sample sample_metalhit, rate:[0.5,1,1,1,1].choose, amp: 0.333 | |
sleep [2,4].choose | |
end | |
end | |
end | |
end #tss | |
######################################################################## | |
end #compressor | |
######################################################################## | |
live_loop :texture2 do | |
with_bpm 6 do | |
with_fx :flanger, phase: [1,2,4,8,16,32].choose, mix: rrand(0.2,0.5) do | |
use_synth :fm | |
with_fx :pitch_shift, pitch: -8, window_size: rrand(0.001,0.01) do | |
play scale(:g2, :spanish).choose, | |
divisor: [2,4,8].choose, divisor_slide: 4, | |
pan: rrand(-0.8,0.8), pan_slide: [1,2,3,6].choose, | |
attack: 2, sustain: 2, release: 8, | |
amp: rrand(2,5.2) *0.7 *0.1 | |
sleep 2 | |
use_synth :fm | |
play chord(scale(:g2, :spanish).choose,:minor), | |
divisor: [[2,4].choose,rrand(0,4)].choose, | |
divisor_slide: 4, | |
attack: [2,4].choose, sustain: 2, | |
release: [8,8,8,16].choose, | |
amp: rrand(2,6) *0.7 *0.1 | |
sleep 2 | |
play scale(:g2, :super_locrian).choose, | |
divisor: [4,8].choose, | |
attack: 2, sustain: 2, release: [6,8,12,16].choose, | |
pan: rrand(-0.6,0.6), pan_slide: [1,2,3,6,12].choose, | |
divisor_slide: 4, amp: rrand(1,5.3) *0.7 *0.1 | |
sleep 4 | |
end | |
end | |
end | |
end | |
######################################################################## | |
sleep [0,0,0,0,1,2,3,4].choose | |
######################################################################## | |
live_loop :texture3 do | |
with_bpm 24 do | |
t = Time.new | |
use_synth :fm | |
with_fx :pitch_shift, pitch: -2, window_size: rrand(0.01,0.1) do | |
with_fx :vowel, voice: [1,2,3,4].choose, | |
vowel_sound: [1,2,3,4,5].choose do | |
with_fx :pitch_shift, pitch: [1,2,4].choose, | |
window_size: rrand(0.001,0.01), mix: 0.77 do | |
### influenced by the hours: | |
play ((scale(:g2, :spanish).choose) +12 - t.hour), | |
divisor: [2,4,8].choose, divisor_slide: 4, | |
pan: rrand(-0.8,0.8), pan_slide: [1,2,3,6].choose, | |
attack: [2,4,8].choose, sustain: 2, release: 8, | |
amp: rrand(2,5.4) *1.2 *0.1 | |
sleep 4 | |
### influenced by the minutes: | |
use_synth :fm | |
play (chord(scale(:g2, :spanish).choose,:minor) -30 + t.min), | |
divisor: [[2,4].choose,rrand(0,4)].choose, | |
divisor_slide: 4, | |
attack: [2,4].choose, sustain: 2, | |
release: [8,8,8,16].choose, | |
amp: rrand(2,6) *1.2 *0.1 | |
sleep 2 | |
### influenced by the seconds: | |
play ((scale(:g3, :minor_pentatonic).choose) -30 + t.sec), | |
divisor: [4,8].choose, | |
attack: 2, sustain: 2, release: [6,8,12,16].choose, | |
pan: rrand(-0.6,0.6), pan_slide: [1,2,3,6,12].choose, | |
amp: rrand(1,5.22) *1.2 *0.1 | |
sleep 2 | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment