home/ atoms/ sonicpi-bad-run-keeps-loops-playing

A Sonic Pi syntax error aborts the run but all currently running live_loops keep playing

Sonic Pi parses the entire buffer on Run. A syntax error (unbalanced do/end, bad bracket) aborts the run and prints to the log, but does not stop any live_loops that are already running from a previous successful run. This is the same forgiving property as Strudel’s evaluate-on-save: a bad edit never silences the performance. The old loops keep playing until a good run replaces them, allowing the coder to fix the error while the music continues.

Examples

Running a buffer with an unbalanced do/end — the log shows a SyntaxError but the drum and bass loops from the previous run keep playing. Fix the error and re-run to update.

Assessment

What happens to currently playing live_loops when a new Sonic Pi run contains a syntax error? Contrast this with what happens when a runtime error occurs inside a live_loop.

“previously running `live_loop`s keep playing** (a bad run does not stop audio —”
context/ · L5-debug/sonicpi.md · chunk 1