Every Sonic Pi live_loop body must call sleep or sync or it stops with a runtime error
In Sonic Pi, live_loop is an infinite repetition construct. If the loop body completes without advancing time — i.e. without calling sleep or sync — Sonic Pi raises a runtime error (‘live_loop :x did not sleep!’) and stops that loop. The minimum viable live_loop contains exactly one sleep call so time always advances. sync :tag also satisfies the requirement by blocking until a cue is received. Other loops continue running when one stops from this error.
Examples
live_loop :x do; play 60; end — error, stops. live_loop :x do; play 60; sleep 1; end — valid, runs forever at the given tempo.
Assessment
Write the minimum valid Sonic Pi live_loop. Explain why the loop must call sleep or sync and what error occurs if it doesn’t.