Hi, I found a possible solution to solve the timing issue of sync:
when a live_loop sleeps longer than the cuer loop, it has to wait for another cue to trigger. e.g.
live_loop A sleeps 1, live_loop B sleeps 3 syncing with A, then the actual cycle of B is 4 instead of 3.
So my solution is removing all the sleeps from B, use a condition statement instead.
But this solution highly rely on ruby’s basic arithmetic operation! hope in the future sonic still support this.
uncomment do
live_loop :met, delay: 0.01 do
play :b6
sleep 1
end
end
live_loop :foo do
sync :met
play :e4, release: 0.5
#sleep 1
end
live_loop :bar do |x|
sync :met
if x % 3 == 0
sample :bd_haus
#sleep 3
end
x += 1
end
Also this is only a walk-around, it cannot solve sync timing issue once and for all. For example if you still need sleep in your code, and the total cycle is larger than the metronome sleep duration and it is the Integer multiple of the metronome sleep duration, then you always have to wait for another cue! e.g. sleep 8 in B, syncing with A, A sleep 2, then the total cycle of B is 8 + 2 = 10. The only solution is make B sleep 8 - 0.01…