Skip to content

Instantly share code, notes, and snippets.

@lapwat

lapwat/dubyflow.rb

Created Nov 6, 2017
Embed
What would you like to do?
use_bpm 130
use_synth :piano
x = (ring 0.75, 4)
pans = (range -0.75, 0.75, 0.5).mirror
frequencies = (ring 1)
chords = :e3
chord_scale = (ring :minor, :minor, :minor, :minor)
lfo = (range 40, 70, 5).mirror
live_loop :chords do
#stop
sync :beat
with_fx :echo, phase: 0.75, decay: 6 do
with_fx :pan, pan: pans.tick(:c) do
with_fx :lpf, cutoff: lfo.tick(:d) do
with_fx :reverb, room: 0.7, damp: 0.8 do
with_synth_defaults attack: 0.05, release: 0.3 do
with_synth :sine do
play (chord chords, chord_scale.tick(:a)), amp: 1
sleep 1.5
play (chord chords, chord_scale.tick(:b)), amp: 0.5
end
end
end
end
end
end
sleep 2.4
end
live_loop :amb2 do
stop
sync :beat
sample :ambi_piano
sleep 7.9
end
bass_notes = (ring :e2, :c2, :a1, :c2, :e2, :e2)
bass_len = (ring 2, 2, 2, 1, 5, 4)
i = 0
live_loop :bass do
#stop
sync :beat
with_fx :echo, phase: 1.5, decay: 4 do
with_synth :fm do
play bass_notes.tick(:bass), attack: 0.03, divisor: 1, depth: 2.5, amp: 0.7
sleep bass_len.tick(:len) - 0.1
end
end
i = (i + 1) % 6
end
live_loop :kick do
#stop
sync :beat
with_fx :lpf, cutoff: 50 do
sample :bd_gas, rate: 1, amp: 2
end
end
live_loop :beat do
sleep 1
end
live_loop :hats do
#stop
if (spread 3, 8).tick then
# (spread 3, 8) produces this pattern: * _ _ * _ _ * _
with_fx :rhpf, cutoff: 125, res: 0.8 do
with_synth :pnoise do
play :d1, amp: 1,
attack: 0.05, decay: 0.08, release: 0.1
end
end
end
sleep 0.25
end
live_loop :noise_hats do
sync :kick
# Create hi-hats by slicing continuous noise
with_fx :slicer, mix: 1, phase: 0.25, pulse_width: 0.1 do
with_fx :hpf, cutoff: 130 do
with_synth :noise do
play :d1, decay: 1, amp: 1
end
end
end
sleep 1
end
open_hats_cutoffs = range(120, 130, 0.5).mirror
live_loop :open_hats do
stop
sync :kick
with_fx :echo, amp: 1,
mix: 0.4, decay: 4, phase: 0.75 do
with_fx :hpf, cutoff: open_hats_cutoffs.tick do
with_fx :reverb, mix: 0.4, room: 0.8 do
sleep 0.5
sample :drum_cymbal_open, start: 0.2, finish: 0.3, amp: 0.5
sleep 0.5
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment