sync :drum if one_in(6)
@kniknoo: that’s an interesting use of the sync
-commant. I will check this out …
@all: It all depends on where your preferences are, I think. My main concern is not, whether the code will start with a delay of one beat (refering to my example with :metro
). I am more concerned about to be able to stop
a loop, start it again and have it in sync with the others.
Here is an example on what I mean:
# Marks the beats
live_loop :beat do
sample :elec_blip2, rate: 1, amp: 0.25
sleep 1 # counts every beat
end
# Marks 4 bars
live_loop :four_bars, sync: :beat do
sample :elec_blip2, rate: 1.5, amp: 0.5
sleep 16 # counts 4 bars
end
# Bass Line "Radio Musicola", Nik Kershaw
bassline = (ring :b2,:b3,:e2,:e2,:r,:r,:e3,:g2,
:r,:e2,:g3,:e2,:r,:g3,:e2,:g2,
:r,:e3,:e2,:g3,:e2,:r,:g2,:r,
:e2,:g3,:e2,:g2,:r,:d2,:e2,:g2,
:a2,:r,:e2,:a2,:r,:e3,:a3,:a2,
:gs2,:r,:r,:e2,:gs2,:gs3,:e2,:gs3,
:r,:e2,:e3,:gs3,:e2,:r,:gs3,:e2,
:gs2,:r,:e3,:gs2,:r,:e2,:a2,:as2)
# bassline
live_loop :bass_line, sync: :four_bars do
stop # comment to start loop; should be in sync with :pad
use_synth :fm
use_synth_defaults amp: 1.0, attack: 0.0, attack_level: 1.5, sustain: 0.15, release: 0.05, cutoff: 70
play_pattern_timed bassline, 0.25
end
# chords
live_loop :pad, sync: :four_bars do
stop # comment to start loop; should be in sync with :bass
use_synth :fm
use_synth_defaults amp: 0.25, attack: 0.1, sustain: 0.5, release: 3
with_fx :echo, phase: 1.0, decay: 2 do
with_fx :reverb, room: 0.75, mix: 0.75 do
with_fx :flanger do
with_transpose 12 do
play [:b3, :b4, :d4, :fs4, :a4, :fs5]
sleep 1.5
play [:d3, :g4, :a4, :d4, :g5], release: 6
sleep 6.5
play [:a3, :e4, :a4, :b4, :e5]
sleep 1.5
play [:gs3, :gs4, :e4, :b4, :e5], release: 6
sleep 6.5
end
end
end
end
end