Skip to content

Instantly share code, notes, and snippets.

@AlexandreRangel
Created May 29, 2016 22:23
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/b2e97153b900585890359fcab825b324 to your computer and use it in GitHub Desktop.
Save AlexandreRangel/b2e97153b900585890359fcab825b324 to your computer and use it in GitHub Desktop.
# "i'm at home" v18 Alexandre rANGEL www.quasecinema.org
# 29 May 2016 Sonic Pi 2.10
use_bpm 96; use_random_seed Math::PI; set_sched_ahead_time! 4
set_volume! 0.66
sample_scratch = '/Users/rangel/pisamples/scratch.wav' #www.freesound.org/people/junggle/sounds/29940/
sample_train = '/Users/rangel/pisamples/train.wav' #www.freesound.org/people/lex1975/sounds/114468/
sample_barceloneta = '/Users/rangel/pisamples/barceloneta.wav' #www.freesound.org/people/barcelonetasonora/sounds/186337/
load_samples [sample_scratch,sample_train,sample_barceloneta,:bd_808,:bd_haus]
#################################################################################
puts "let's go!"
live_loop :metro do
clock = tick(:metro); bar = clock / 4; puts "bar : #{bar}"
puts ring("1 |","2 | |","3 | | |","4 | | | |")[clock]; sleep 1
end #metro
#################################################################################
sample sample_train, attack: 2, pan: -0.2, amp: 1.5; sleep 6
sample sample_barceloneta, start: 0.4448, attack: 6, release: 4, pan: 0.2, amp: 20
sleep 29
sample :bd_haus, amp: rrand(1,1.2) * [2.0,2.2].choose
with_fx :tanh, mix: 0.5 do
live_loop :leadSlow1 do
with_bpm 1.5 do
with_fx :wobble, phase: [2,4,8].choose, mix: 0.7 do
with_fx :pitch_shift, pitch: [-14,-12.5,-12,-11.5,-10].choose, window_size: rrand(0.002,0.006) do
with_fx :bitcrusher, sample_rate: rrand(8800,15000), mix: 0.7 do
with_fx :reverb, room: rrand(0.01,0.99), mix: rrand(0.2,0.7) do
use_synth :dsaw
ns = scale(:c2, :chinese, num_octaves: rrand_i(1,3))
play ns.choose,detune: rrand(-72,72),attack: rrand(0.1,0.2),release: rrand(0.01,2),cutoff: rrand(80, 110),cutoff_slide: [0.25,1].choose,pan: rrand(-0.9,0.5),pan_slide: [0.25,0.5,1].choose,amp: rrand(0.55,0.90),amp_slide: [0.5,1,2,4].choose
sleep 0.5
end #reverb
end #bitcrush
end #pitch
end #wobble
end #bpm
end #:leadSlow1
sample :bd_haus, amp: rrand(1,1.2) * [2.0,2.2].choose
sleep 4
sample :bd_haus, amp: rrand(1,1.2) * [2.0,2.2].choose
#################################################################################
live_loop :leadFast1 do
with_bpm 1.5/4.0 do
with_fx :wobble, phase: 4, mix: rrand(0.333,0.9) do
with_fx :pitch_shift, pitch: rrand(-12.6,1.6), window_size: rrand(0.001,0.007) do
with_fx :bitcrusher, sample_rate: rrand(8800,16000), mix: rrand(0.3,0.9) do
with_fx :slicer, phase: 1.0/[0.25,0.5,1,2,4,8].choose, phase_slide: [0.5,1,2].choose do
with_fx :wobble, phase: [0.5,1,2,4,8,16].choose do
use_synth [:chipbass,:zawa].choose
ns = scale(:c1, [:whole,:whole_tone].choose, num_octaves: rrand_i(1,2))
play ns.choose,detune: rrand(-72,58),attack: rrand(1.05,1.75),release: rrand(0.01,2),cutoff: rrand(100, 110), cutoff_slide: [0.25,2].choose,pan: rrand(-0.5,0.9),pan_slide: [0.5,1,2].choose,amp: rrand(0.55,0.80),amp_slide: [0.5,1,2,4].choose
sleep 1.0/[1,2,4,8].choose
end #:whammy
end #:slicer
end #:bit
end #:pitch
end #:wobble
end #bpm
end #:leadFast1
sample :bd_haus, amp: rrand(1,1.2) * [2.0,2.2].choose
sleep 2
sample :bd_haus, amp: rrand(1,1.2) * [2.0,2.2].choose
#################################################################################
with_fx :flanger, phase: [4,8,16].choose, mix: 0.333 do
with_fx :pitch_shift, pitch: [-4,-8,-12,-16,-20].choose, window_size: [0.001,0.01].choose, mix: 0.25 do
live_loop :scratch do
with_fx :slicer, phase: [0.25,0.25,0.25,1].choose, mix: [1,0.5,1,1,1].choose do
with_fx :panslicer, phase: [0.25,0.5,1,1,1,2,2,2].choose, pan_min: [-0.77,-0.5,-0.3].choose, pan_max: [0.3,0.5,0.77].choose do
with_fx :bitcrusher, bits: rrand(8,12), mix: 0.666666 do
with_fx :echo, phase: [0.25,0.5,0.5,0.5,0.75,1,2].choose, decay: [1.5/2,1.5].choose, mix: rrand(0.5,1.0), reps: 2 do
with_fx :octaver, mix: rrand(0.4,0.88) do
sample sample_scratch, start: 0.01, finish: 0.10, rpitch: rrand(-8,2), rate: rrand(0.74,1.0) if one_in(2)
sleep 0.5
sample sample_scratch, start: 0.48, finish: 0.5, rpitch: rrand(-12,2), rate: rrand(-0.24,-0.26), window_size: rrand(0.0001,0.001), amp: rrand(0.5,0.8) if one_in(5)
sleep 0.5
sample sample_scratch, start: 0.25, finish: 0.4, rpitch: rrand(-12,2), rate: rrand(0.9,1.1), amp: rrand(0.5,0.8) if one_in(4)
sleep 0.5
sample sample_scratch, start: 0.48, finish: 0.5, rpitch: rrand(-8,2), rate: 0.25, window_size: rrand(0.0003,0.0006), amp: rrand(0.5,0.8) if one_in(2)
#another sound:
x = rrand(0.001,0.9)
with_fx :vowel, voice: [1,2,3,4].choose, vowel_sound: [1,2,3,4,5].choose do
with_fx :wobble, phase: [0.5,1,2,4].choose do
sample sample_scratch,start: x,finish: x+0.1,rpitch: rrand(-16,2),rate: [0.25,0.25/2].choose,window_size: rrand(0.0003,0.0006),amp: rrand(0.0,1.222) if one_in(2)
end #wobble
end #vowel
sleep 1
end #octaver
end #echo
end #bit
end #panslicer
end #slicer
end #:scratch
end #pitch
end #flanger
#################################################################################
with_fx :slicer, phase: 0.5, phase_offset: 0.5, smooth_down: [0.25,0.25,0.5,1].choose do
live_loop :leadSlow2 do
with_bpm 3 do
x = [-16,-12,-8,-4,-2,0,2].choose
with_fx :pitch_shift, pitch: x, pitch_slide: [0.25,0.5,1,2].choose,
window_size: rrand(0.0001,0.001) do
with_fx :bitcrusher, sample_rate: rrand(8800,14000), mix: 0.7 do
with_fx :gverb, room: rrand(7,27), mix: rrand(0.2,0.5) do
use_synth :dsaw
ns = scale(:c2, :chinese, num_octaves: rrand_i(1,3))
play ns.choose, detune: rrand(-100,100),attack: rrand(0.05,0.1),release: 0.05,cutoff: rrand(80, 120),cutoff_slide: 0.25,pan: rrand(-1,0.2),pan_slide: [0.25,0.5,1].choose,amp: rrand(0.3,0.75),amp_slide: [0.5,1,2,4].choose if one_in(3)
sleep 2
end #gverb
end #bit
end #pitch
end #bpm
end #:leadSlow2
#################################################################################
live_loop :leadFast2 do
with_bpm 1.5 do
x = [-16,-12,-8,-4,-2,0,2].choose
with_fx :pitch_shift, pitch: x, pitch_slide: [0.25,0.5,1,2].choose, window_size: rrand(0.0001,0.001) do
with_fx :bitcrusher, sample_rate: rrand(6000,14000), mix: 0.7 do
with_fx :slicer, phase: 0.25/[0.25,0.5,1,2,4,8,16].choose, phase_slide: 1 do
with_fx [:whammy,:wobble].choose, phase: [1,2,4,8,16].choose do
use_synth [:zawa,:fm].choose
ns = scale(:c1, [:whole,:whole_tone].choose, num_octaves: rrand_i(1,2))
play ns.choose,detune: rrand(-100,100),attack: rrand(1.05,1.1),release: 0.05,cutoff: rrand(100, 120),cutoff_slide: 0.25,pan: rrand(-0.2,1),pan_slide: [0.5,1,2].choose,amp: rrand(0.3,0.75),amp_slide: [0.5,1,2,4].choose if one_in(3)
sleep 0.25/[1,2,4,8].choose
end #whammy
end #slicer
end #bit
end #pitch
end #bpm
end #:leadFast2
end #slicer
sleep 38
sample sample_barceloneta, attack: 2, release: 4, amp: 12, pan: 0.7
#################################################################################
k = 0 #initialize k
live_loop :kick do
with_fx :echo, reps: 2, phase: ring(0.25,0.25,0.5,0.25,1)[k], mix: [0.2,0.3,0.4,0.5].choose do
sample :bd_808, rate: ring(1, -1)[(k/2.0).to_int], amp: ring(0.222,1.6)[k] * 2.4
sample :bd_haus, amp: ring(rrand(1,1.2), rrand(1.4,1.6))[k] * [1.0,1.2].choose
end
k = k + 1
sleep ring(0.25,1,1,1,1,1,1,1,1,0.25,0.25,1,1,1,1,1,1,1,1,1,1,1,1,0.25,0.25,0.25)[k] *2
sample sample_barceloneta, amp: rrand(27,35)*1.333, start: 0.689, finish: 0.686 + 0.019, attack: 0.1, release: 0.07, rate: rrand(0.222,1.3) if one_in(16)
sample sample_barceloneta, attack: 2, release: [2,4,6].choose, amp: rrand(8,15), pan: [-1.0,1.0].choose if one_in(102)
end #:kick
sleep 120; sample sample_barceloneta, attack: 2, release: 4, amp: 12, pan: -0.7
#
end #tahn
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment