home/ atoms/ sonicpi-duplicate-loop-name-replaces

Defining two Sonic Pi live_loops with the same name does not create two voices — the second silently replaces the first

In Sonic Pi, live_loop names are unique identifiers. If a second live_loop :x is defined in the buffer (whether in the same run or a subsequent run), it replaces the first — only one loop with that name runs at any time. This is the intended hot-swap mechanism but is a silent bug when two independent voices are needed. The symptom is unexpected silence or merged behavior. The fix is to give each voice a unique name: :drums, :bass, :arp.

Examples

Two live_loops both named :beat — only the second runs. Rename to :kick and :snare for two independent voices.

Assessment

Explain what happens when two live_loops share the same name in Sonic Pi. What is the intended use of this behavior, and when does it become a bug?

“second **replaces** the first (one voice, not two) | Give each voice a unique na”
context/ · L5-debug/sonicpi.md · chunk 1