home/ atoms/ sonic-pi-live-loop-sync

live_loops auto-generate cue events that other live_loops can sync on for phase alignment

Each live_loop emits a cue event with its own name at the start of every iteration. A second live_loop can contain sync :first_loop_name to wait for the first loop’s boundary before proceeding. This locks their phases together without stopping. The preferred remedy for two loops that have drifted out of phase: fix sleep values to produce a compatible ratio, then add sync to snap phase.

Examples

live_loop :foo do play :e4, release: 0.5 sleep 0.5 end

live_loop :bar do sync :foo sample :bd_haus sleep 1 end

Assessment

Start two live_loops that drift (sleep 0.4 vs sleep 1). Describe what you hear. Then add sync to fix it without stopping either loop.

“live loops work automatically with the thread cue mechanism”
corpus · sonic-pi-built-in-tutorial · chunk 19