Skip to content

Instantly share code, notes, and snippets.

@jprudent
Created Sep 28, 2020
Embed
What would you like to do?
Loop2
use_bpm 102
delta = (line 0, 0.1, steps: 5).mirror
chords = knit(:minor, 5, :m7, 5)
tonics = knit(60, 10, 65, 10)
live_loop :foo do
use_synth :dsaw
sync :kick
play chord(tonics.tick, chords.tick(:chord)), sustain: 1.9, amp: 0.1
sleep 1
end
kicks = [:bd_haus, :bd_tek]
live_loop :kick do
with_fx :reverb, room: 0.1 do
cue :kick
sample choose(kicks)
sleep 1
end
end
claps = (ring false, false, false, true)
live_loop :zip_clap do
sync :kick
if (claps.tick)
sample :drum_cymbal_closed, attack: 0.1, sustain: 0.5, release: 0.1, amp: 2, cutoff: rrand(100,120)
end
sleep 1
sample :drum_cymbal_closed, attack: 0.1, sustain: 0.5, release: 0.1, amp: 1, cutoff: rrand(100,120) if one_in(3)
end
define :mk_melody do |seed|
with_random_seed seed do
(scale 60, :minor_pentatonic).take(5).shuffle.mirror
end
end
seeds = knit(4, 4, 19983, 2, 55, 1, 88, 4)
live_loop :melody do
use_synth :tb303
melody = mk_melody(seeds.tick)
if one_in(10)
with_synth :chiplead do
play_pattern_timed melody, 0.5, amp: 0.2, cutoff: rrand(70, 100)
end
else
play_pattern_timed melody, 0.5, amp: 0.2, cutoff: rrand(70, 100)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment