diff --git a/src/engine/audioEngine.js b/src/engine/audioEngine.js index d962962..8e90623 100644 --- a/src/engine/audioEngine.js +++ b/src/engine/audioEngine.js @@ -35,8 +35,14 @@ export function unsubscribeTick(id) { function startMasterClock() { if (_masterClock) return; - _masterTime = Tone.now(); + _masterTime = 0; // Will be set from first tick + let _started = false; _masterClock = new Tone.Clock((time) => { + // Capture start time from the FIRST callback — guarantees same clock source + if (!_started) { + _masterTime = time; + _started = true; + } const elapsed = time - _masterTime; for (const cb of _tickListeners.values()) { cb(time, elapsed);