fix(BellEngine): remove hardcoded 0.5 s gap between melody loops (F-078, v2.5.1)

playbackLoop() slept 500 ms after every loop whenever the run had no end
time (infinite, interval with total_duration 0, v1 continuous_loop with no
total), so those modes paused between loops while timed / interval with a
total did not. The delay was meant to give Player time to pause/stop, but
play-once already stops synchronously in onMelodyLoopCompleted(), stop is
checked before every pass and pause after every loop. Every looping mode
now plays loop-to-loop with no gap; single is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 11:10:06 +02:00
co-authored by Claude Opus 5.5
parent 5d8600d6bf
commit 1aff1e987b
4 changed files with 26 additions and 8 deletions
+1 -1
View File
@@ -202,7 +202,7 @@ Exact timing, for all modes:
- **Status during that last loop:** at a segment end, `status/playback` goes to `paused` straight away while the loop finishes ringing. At the end of a `timed`/`interval` run it goes to `stopping`, then `idle` when the loop ends. `single` goes from `playing` directly to `idle`.
- **The pause is measured from the end of that loop:** the bells are silent for the full `pause_duration`, then `status/playback` goes back to `playing` and a new `duration` segment starts.
- **`total_duration` (interval) counts from the start of the play, pauses included.** If it runs out during a pause, playback stops at once (`paused` → `idle`).
- **Gap between loops:** whenever the run has no end time (`single`, `infinite`, `interval` with `total_duration: 0`), the engine waits ~0.5 s after each loop before starting the next one. `timed` and `interval` with a `total_duration` loop with no gap.
- **No gap between loops:** in every looping mode the next loop starts right after the previous one; the last step's beat (`speed`) is the only spacing. (Before v2.5.1, runs with no end time waited ~0.5 s between loops.)
**Legacy timing** (`mode` absent):