I think it is worth reading Sam Aaron’s comments in a previous thread
My solution would be to delay the start of the :metronome loop to give the other loops a chance to start and to be waiting for their initial sync, which ONLY applies the first time round (set in the define line of the live loop). Subsequently none of the loops need a sync, apart from the one with the 7 beat pattern. This needs to be delayed on each pass to the start of the next bar.
So applying this to your original code I get this. (Note ALL loops which are an exact number of bars can be synced directly to metronome. You done really need the loops for 8 beats, but you do ned the loop for 1_bar so that you can restart the 7 beat loop correctly.
Your code modified is below
use_bpm 120
beats_per_bar = 4
############################### TOOLS ###############################
live_loop :metronome,delay: 0.01 do #delay start of this by 0.01 to allow other loops to be ready
use_synth :beep
play :a4, release: 0.5
sleep 1
end
live_loop :_1_bar,sync: :metronome do
use_synth :beep
play :as5, release: 0.5
sleep beats_per_bar
# the cue is sent ONLY NOW /:( so sad no ? NOT ANY MORE!!!
end
live_loop :_4_bars,sync: :metronome do #not required here
sleep beats_per_bar*4
end
live_loop :_8_bars,sync: :metronome do #you don't really need this loop here
sleep beats_per_bar*8
end
live_loop :_16_bars,sync: :metronome do #not used here
sleep beats_per_bar*16
end
############################### live_l_o(U)pssssssssss ###############################
# this loop will start once _4_bars has finished once and become free as as bird no synchronicity
live_loop :loop_sans_sync, sync: :metronome do #:_4_bars
sample :drum_cymbal_hard
sleep 4
end
live_loop :loop_8_beats,sync: :metronome do # sync to :metronome not :_1_bar
# après la durée de la boucle _1_bar 4 beats
#sync :_1_bar
use_synth :sine
riff_8_notes = (ring :c3, :d3, :e3, :f3, :g3, :a3, :b3, :c4)
# this pattern last 8 beats
play_pattern_timed riff_8_notes, 1
# oh it's strange i "miss" the cue "/live_loop/_1_bar" why have i wait the next one ?????
#
end
live_loop :loop_7_beats do
# _1_bar last 4 beats
sync :_1_bar #this loop needs to wait EVERY time for the start of the bar
use_synth :pretty_bell
riff_7_notes = (ring :c6, :d6, :e6, :f6, :g6, :a6, :b6)
# this pattern last 7 beats
play_pattern_timed riff_7_notes, 1
end
To summarise.
You need to delay the start of the main metronome to give other time to be ready to receive sync cues.
All loops that last a whole number of bars can be synced to :metronome
You only need a 1_bar loop if (as in this case) you have a loop which is NOT an integral number of bars. In this case it needs to be delayed until the start of the next bar. Here the sync appears INSIDE the loop and applies on each pass.