melhorando a leitura de projetos no mmpCreator
Deploy / Deploy (push) Successful in 2m8s Details

This commit is contained in:
JotaChina 2025-12-25 16:28:40 -03:00
parent acfebc8f8b
commit 73a61a96f4
1 changed files with 19 additions and 0 deletions

View File

@ -250,8 +250,27 @@ function _animationLoop() {
const loopDuration = loopEndTimeSec - loopStartTimeSec; const loopDuration = loopEndTimeSec - loopStartTimeSec;
newLogicalTime = newLogicalTime =
loopStartTimeSec + ((newLogicalTime - loopStartTimeSec) % loopDuration); loopStartTimeSec + ((newLogicalTime - loopStartTimeSec) % loopDuration);
startTime = now; startTime = now;
appState.audio.audioEditorSeekTime = newLogicalTime; appState.audio.audioEditorSeekTime = newLogicalTime;
// ✅ 1) manter o Tone.Transport em sincronia
try { Tone.Transport.seconds = newLogicalTime; } catch {}
// ✅ 2) permitir reagendamento de clips/patterns
runtimeClipState.clear();
scheduledNodes.forEach(({ player }) => {
try { player.unsync(); } catch {}
try { player.stop(); } catch {}
try { player.dispose(); } catch {}
});
scheduledNodes.clear();
// ✅ 3) reinicia patterns no Transport (se houver scheduleOnce para notes)
try {
stopSongPatternPlaybackOnTransport();
startSongPatternPlaybackOnTransport();
} catch {}
} }
} }