Skip to content

Instantly share code, notes, and snippets.

@mbutz
Created October 22, 2017 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mbutz/ed8105fa24c0ccd1eee9c078ea9a65de to your computer and use it in GitHub Desktop.
Save mbutz/ed8105fa24c0ccd1eee9c078ea9a65de to your computer and use it in GitHub Desktop.
use_bpm 120
use_synth :piano
use_synth_defaults attack: 0.0, release: 0.75, stereo_width: 1, vel: 0.15
phrase_len = 64
cycle_len = phrase_len * 3 # here: 4 bars
chn = 1
live_loop :metro do
sleep 4
end
with_fx :reverb, room: 0.75, mix: 0.65 do
live_loop :bass, sync: :metro do
cycle_cnt = tick % cycle_len + 1
phrase_no = look/phrase_len
puts "-----------------------------------------------"
puts "Tick: #{look} | %: #{cycle_cnt} | Phrase No.: #{phrase_no} |"
puts "-------------------------------------------------"
# Set a different synth each bar
if cycle_cnt <= phrase_len then
bass_line = (chord :a1, :m7, num_octaves: 2)
elsif cycle_cnt <= phrase_len * 2 then
bass_line = (chord :c2, :add2, num_octaves: 2)
elsif cycle_cnt <= phrase_len * 3 then
bass_line = (chord :d2, '7sus4', num_octaves: 2)
end
if spread([9,11].choose,16).look
midi_note_on bass_line.look, channel: chn
end
sleep 0.25
end
live_loop :voice1, sync: :metro do
#stop
voice1_line = (chord :c4, :M, num_octaves: 1)
2.times do
if spread([5,9].choose,16).tick
midi_note_on voice1_line.look, channel: chn
end
sleep 0.25
end
end
live_loop :voice2, sync: :metro do
#stop
voice2_line = (chord :d4, :M, num_octaves: 1)
2.times do
if spread([5,13].choose,16).tick
midi_note_on voice2_line.look, channel: chn
end
sleep 0.25
end
end
end #reverb
live_loop :hihat, sync: :metro do
sleep 0.5
sample :drum_cymbal_pedal, finish: 0.5, amp: 0.125
sleep 0.5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment