Skip to content

Instantly share code, notes, and snippets.

@AlexandreRangel
Created January 5, 2016 00:22
Show Gist options
  • Save AlexandreRangel/ec146127790bf0ab12a1 to your computer and use it in GitHub Desktop.
Save AlexandreRangel/ec146127790bf0ab12a1 to your computer and use it in GitHub Desktop.
Sonic Pi music code
# Alexandre rANGEL / www.quasecinema.org
# rain worship-v04
# Sonic Pi 2.9 / 23-Out-2015
use_bpm 96
clock = 0
t = Time.new
tx = (t.year + t.month + t.day + t.hour + t.min + t.min)
use_random_seed tx
puts tx #2090
##############################
# countdown sync
#use_synth :beep
#play 90, attack: 0, sustain: 1, release: 0, amp: 0.75
#sleep 2
#play 90, attack: 0, sustain: 1, release: 0, amp: 0.75
#sleep 3
##############################
live_loop :metro do
cue :metro
sleep 0.5
#clock = tick
#puts clock
end #metro
##############################
live_loop :texture do
with_fx :pitch_shift, pitch: rrand(-12,-6),
window_size: rrand(0.01,0.1) do
use_synth :growl
play :g2, release: 18, detune: rrand(-2,2) + t.sec / 4,
pan: rrand(-0.7,0.7), pan_slide: 1,
amp: 1.3
play :c3, release: 6, detune: rrand(-20,0) + t.sec / 4,
pan: rrand(-0.7,0.7), pan_slide: 1,
amp: 1.3
play :e2, release: 2, detune: rrand(-20,0) + t.sec / 3,
pan: rrand(-0.7,0.7), pan_slide: 1,
amp: 1.3
sleep 0.5 / [1,2].choose
use_synth [:mod_saw,:mod_pulse].choose
play :e2, release: 2, detune: rrand(-40,0) + t.sec / 3,
amp: 1.5, pan: rrand(-1.0,1.0), pan_slide: 1
sleep 1.5 / [1,2].choose
end
end
##############################
live_loop :tss do
with_fx :flanger do
with_fx :slicer, phase: [0.1,0.2,0.5,0.75].choose do
with_fx :echo, phase: 1.0/(ring 4,2,8,0.5)[tick] do
use_synth :pnoise
play 120, attack: 0, sustain: 0.1, release: 0.1,
detune: rrand(-36,22),
amp: (ring 1,1.2,1,0.5)[tick]* 1.1
end
end
end
sleep 1.0/4
end
##############################
live_loop :kick do
with_fx :bitcrusher, bits: (ring 10,10,8)[tick], mix: 0.3 do
with_fx :flanger, mix: 0.3 do
sample :bd_klub, amp: 1.8
sample :bd_haus, amp: 0.8
sleep 1.5 / (ring 2,2,2,2,2,3)[tick]
end
end
end
##############################
live_loop :bip do
use_synth :beep
#with_fx :bitcrusher, bits: (ring 10,8,6)[tick], mix: 0.2 do
#with_fx :slicer, phase: [0.1,0.2,0.5,0.75].choose, mix: 0.1 do
with_fx :echo, phase: 0.5 do
play (ring 62,40,65,40,52,44)[tick/5] + 12, attack: 0, sustain: 0.1,
release: (ring 0.01,0.1,0.2,0.5)[tick],
amp: rrand(0.5,0.7),
pan: rrand(-1.0,1.0),
pan_slide: (ring 0.1,0.2,0.5,0.1)[tick]
# end
# end
end
sleep 5 / 3
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment