Skip to content

Instantly share code, notes, and snippets.

@lapwat

lapwat/rain.txt

Last active Mar 7, 2016
Embed
What would you like to do?
Rain
use_bpm 110
master_v = (ramp *range(1.1, 1, -0.1))
waves_v = 0
kick_v = 0
snare_v = 0
cymb_v = 0
octaves_v = 0
woosh_v = 0
cymb_r = ring(1)
kick_r = ring(1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1)
snare_r = ring(0, 1)
gamme = ring(:a2, :d2, :e2, :a2)
live_loop :cymb do
sync :clk
128.times do
sample :drum_cymbal_soft, sustain: 0, release: 0.05, amp: cymb_v * cymb_r.tick(:r) * master_v.tick, cutoff: 85
sleep 0.25
end
end
live_loop :kick do
sync :clk
64.times do
sample :bd_boom, amp: kick_v * kick_r.tick(:r) * master_v.tick
sleep 0.5
end
end
live_loop :snare do
sync :clk
64.times do
sample :drum_tom_hi_soft, attack: 0, sustain: 0, release: 0.05, amp: snare_v * snare_r.tick(:r) * master_v.tick
sleep 0.5
end
end
live_loop :waves do
use_synth :saw
with_fx :reverb, room: 1 do
with_fx :echo, mix: 1, phase: 0.4, decay: 4 do
play_chord chord(gamme.tick(:waves), :minor), release: 8, cutoff: 70, decay: 0.6, amp: waves_v * master_v.tick
end
end
sleep 8
end
live_loop :octaves do
use_synth :saw
4.times do
sc = scale(gamme.tick(:scale) - 12, :minor_pentatonic, num_octaves: 1)
sc = sc[0..3]
cutoff = 70
4.times do
with_fx :reverb do
play sc.tick(:up), release: 4, cutoff: cutoff, amp: 0.5 * octaves_v * master_v.tick
sleep 1
end
end
3.times do
with_fx :slicer, phase: 0.25 do
play invert_chord(sc, -1).reverse.tick(:down), cutoff: cutoff, release: 2, amp: 0.5 * octaves_v * master_v.tick
sleep 0.5
end
end
sc.tick(:down)
sleep 2.5
end
end
live_loop :woosh do
use_synth :noise
4.times do
sc = scale(gamme.tick(:scale), :minor_pentatonic, num_octaves: 1)
sc = sc[0..3]
sleep 5
3.times do
play invert_chord(sc, -1).reverse.tick(:down), cutoff: 80, release: 1, amp: 0.2 * woosh_v * master_v.tick
sleep 1
end
play invert_chord(sc, -1).reverse.tick(:down), cutoff: 80, release: 4, amp: 0.2 * woosh_v * master_v.tick
sleep 8
end
end
live_loop :clk do
sleep 0.25
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment