Skip to content

Instantly share code, notes, and snippets.

@klahrich
Created June 16, 2016 01:29
Show Gist options
  • Save klahrich/eb057c0a4686c08d97cbdeb5b788f509 to your computer and use it in GitHub Desktop.
Save klahrich/eb057c0a4686c08d97cbdeb5b788f509 to your computer and use it in GitHub Desktop.
use_bpm 50
k = 0
#main loop beat duration
m = 2
live_loop :main do
sleep m
k = k + 1
end
loop0 = Hash.new(){}
loop0[:alive] = lambda {k >= 4}
loop0[:beats] = lambda {4}
loop0[:amp] = lambda {k==15 ? 0 : 1}
live_loop :loop0 do
sync :main
if loop0[:alive].call()
with_fx :distortion do
loop0[:beats].call().times do
sample :drum_heavy_kick, amp: loop0[:amp]
sleep m/loop0[:beats].call().to_f
end
end
end
end
loop0b = Hash.new(){}
loop0b[:alive] = lambda {k >= 4 && k <8}
live_loop :loop0b do
sync :main
if loop0b[:alive].call()
with_fx :krush do
with_fx :echo, phase:0.125 do
2.times do
sample :drum_cymbal_hard, rate:4, amp:0.5
sleep m/2.0
end
end
end
end
end
loop1 = Hash.new{}
loop1[:active] = lambda {k < 16}
loop1[:instr] = lambda {k < 8 ? :prophet : :piano}
loop1[:notes1a] = [:C3, :rest, :rest, :Ds3,
:rest, :rest, :C3, :rest,
:rest, :Ds3, :rest, :rest,
:C3, :rest, :C3, :rest]*2
loop1[:notes2a] = [:C3, :rest, :rest, :F3,
:rest, :rest, :C3, :rest,
:rest, :F3, :rest, :rest,
:C3, :rest, :C3, :rest]*2
loop1[:notesa] = (loop1[:notes1a] + loop1[:notes2a]).ring
loop1[:notes1b] = [:C4, :rest, :rest, :Ds4,
:rest, :rest, :C4, :rest,
:rest, :Ds4, :rest, :rest,
:C4, :rest, :C4, :rest]*2
loop1[:notes2b] = [:C4, :rest, :rest, :F4,
:rest, :rest, :C4, :rest,
:rest, :F4, :rest, :rest,
:C4, :rest, :C4, :rest]*2
loop1[:notesb] = (loop1[:notes1b] + loop1[:notes2b]).ring
loop1[:notes] = lambda {k < 8 ? loop1[:notesa] : loop1[:notesb]}
loop1[:cutoff] =
lambda{
k < 4 ? 70 : (k < 8 ? 80 : 90)
}
#over how many beats do we want this loop to run
loop1[:beats] = 4
loop1[:amp] = lambda {k==15 ? 0 : 1}
live_loop :loop1 do
sync :main
if loop1[:active].call()
with_fx :echo, phase:0.25, mix:0.5 do
loop1[:notes].call().length.times do
synth loop1[:instr].call(), note: loop1[:notes].call().tick, cutoff:loop1[:cutoff].call(),
amp: loop1[:amp].call()
sleep (m * loop1[:beats])/loop1[:notes].call().length.to_f
end
end
end
end
loop2 = Hash.new{}
loop2[:instr] = :drum_cymbal_closed
loop2[:notes] = ([110, 100]*8).ring
loop2[:beats] = 1
loop2[:alive] = lambda { k >= 8 }
live_loop :loop2 do
sync :main
if loop2[:alive].call()
loop2[:notes].length.times do
sample loop2[:instr], cutoff: loop2[:notes].tick, amp:0.75
sleep (m * loop2[:beats])/loop2[:notes].length.to_f
end
end
end
loop3 = Hash.new(){}
loop3[:hits] = ([true, false, false, true,
false, false, true, false,
true, false, false, true,
false, false, false, false]).ring
loop3[:instr] = :bass_voxy_hit_c
loop3[:rate] = ([1]*32 + [1.25]*32).ring
loop3[:alive] = lambda { k >= 4 }
loop3[:beats] = 1
loop3[:fx] = lambda {k < 8 ? :gverb : :reverb}
live_loop :loop3 do
sync :main
if loop3[:alive].call()
with_fx loop3[:fx].call() do
loop3[:hits].length.times do
sample loop3[:instr] if loop3[:hits].tick
sleep (m * loop3[:beats])/loop3[:hits].length.to_f
end
end
end
end
loop4 = Hash.new(){}
loop4[:alive] = lambda {k >= 8}
live_loop :loop4 do
sync :main
if loop4[:alive].call()
with_fx :echo do
sleep 2 * m
sample :ambi_lunar_land, rate:6, attack:1, sustain:4, amp:1
sleep 2 * m
end
end
end
loop5 = Hash.new(){}
loop5[:alive] = lambda {k >= 8}
live_loop :loop5 do
sync :main
if loop5[:alive].call()
with_fx :echo, phase:0.125, mix:0.5 do
sample :drum_splash_hard , rate:0.5, release:2, amp:0.25
sleep 4*m
end
end
end
loop6 = Hash.new(){}
loop6[:alive] = lambda {k >= 8}
loop6[:hits] = ([false, false, false, true,
false, false, true, false,
false, true, false, true,
false, false, true, false]).ring
loop6[:beats] = 1
live_loop :loop6 do
sync :main
if loop6[:alive].call()
with_fx :krush, mix:0.25 do
loop6[:hits].length.times do
sample :perc_snap, rate:0.5, amp:0.85, cutoff:110 if loop6[:hits].tick
sleep (m * loop6[:beats])/loop6[:hits].length.to_f
end
end
end
end
loop7 = Hash.new(){}
loop7[:alive] = lambda {k >= 8 && k!=15}
loop7[:notes1] = ([:C3, :rest, :rest, :rest,
:rest, :rest, :G2, :rest,
:C3, :rest, :Ds3, :rest,
:C3, :rest, :G2, :rest])*2
loop7[:notes2] = ([:D3, :rest, :rest, :rest,
:rest, :rest, :G2, :rest,
:D3, :rest, :Ds3, :rest,
:D3, :rest, :G2, :rest] +
[:D3, :rest, :rest, :rest,
:rest, :rest, :G2, :rest,
:D3, :rest, :F3, :rest,
:Ds3, :rest, :D3, :rest])
loop7[:notes] = (loop7[:notes1] + loop7[:notes2]).ring
loop7[:beats] = 4
loop7[:instr] = :prophet
loop7[:amp] = lambda {k==15 ? 0 : 0.5}
live_loop :loop7 do
sync :main
if loop7[:alive].call()
#with_fx :slicer, phase:0.5, wave:2 do
#with_fx :ixi_techno, phase:2, mix:0.5 do
loop7[:notes].length.times do
synth loop7[:instr], note: loop7[:notes].tick, amp: loop7[:amp].call(), cutoff:80
sleep (m * loop7[:beats])/loop7[:notes].length.to_f
end
#end
#end
end
end
loop8 = Hash.new(){}
loop8[:alive] = lambda {k >= 16}
loop8[:notes] = [:G4, :rest, :rest, :C4,
:rest, :rest, :G4, :rest,
:rest, :rest, :rest, :rest,
:rest, :rest, :rest, :rest,
:G4, :rest, :rest, :C4,
:rest, :rest, :G4, :rest,
:rest, :rest, :G4, :rest,
:Gs4, :rest, :G4, :rest,
:F4, :rest, :rest, :C4,
:rest, :rest, :F4, :rest,
:rest, :rest, :rest, :rest,
:rest, :rest, :rest, :rest,
:F4, :rest, :rest, :C4,
:rest, :rest, :F4, :rest,
:rest, :rest, :F4, :rest,
:G4, :rest, :Gs4, :rest].ring
loop8[:beats] = 4
loop8[:instr] = :prophet
live_loop :loop8 do
sync :main
if loop8[:alive].call()
#with_fx :slicer, phase:2, mix:0.5 do
with_fx :gverb do
loop8[:notes].length.times do
synth loop8[:instr], note: loop8[:notes].tick, amp:0.25, cutof:70
sleep (m * loop8[:beats])/loop8[:notes].length.to_f
end
#end
end
end
end
loop9 = Hash.new(){}
loop9[:alive] = lambda {k >= 16}
loop9[:hits] = ([true, false, false, true,
false, false, true, false,
true, false, false, true,
true, false, false, false]).ring
loop9[:beats] = 1
live_loop :loop9 do
sync :main
if loop9[:alive].call()
with_fx :echo, mix:0.5, phase:0.25 do
with_fx :krush, mix:0.10 do
loop9[:hits].length.times do
sample :drum_snare_hard, amp:0.35, cutoff:[110,120].choose if loop9[:hits].tick
sleep (m * loop9[:beats])/loop9[:hits].length.to_f
end
end
end
end
end
loop10 = Hash.new(){}
loop10[:alive] = lambda {k==15}
loop10[:hits] = ([true, false, false, true,
false, false, true, false,
true, false, false, true,
true, false, true, true]).ring
loop10[:beats] = 1
live_loop :loop10 do
sync :main
if loop10[:alive].call()
with_fx :echo, mix:0.25, phase:0.5 do
with_fx :krush, mix:0.5 do
loop10[:hits].length.times do
sample :drum_snare_hard, rate:0.9, amp:1 if loop9[:hits].tick
sleep (m * loop10[:beats])/loop10[:hits].length.to_f
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment