fix: instrument change keeps loop playback alive

This commit is contained in:
2026-07-26 11:10:31 +07:00
parent e57f6d96d9
commit 9717470bb6
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -6450,10 +6450,13 @@ const App = () => {
stopAllPlayback();
setTimeout(() => {
const context = getAudioContext();
startOffsetTimeRef.current = playingSub.currentTime || 0;
const offset = playingSub.currentTime || 0;
startOffsetTimeRef.current = offset;
startAudioTimeRef.current = context.currentTime;
schedulePianoRollMidi(playingSub, playingSub.currentTime || 0);
startSubTabPlayback(playingSub, playingSub.currentTime || 0);
startBufferOffsetRef.current = offset * (playingSub.speed || 1.0);
schedulePianoRollMidi(playingSub, offset);
startSubTabPlayback(playingSub, offset);
animationFrameIdRef.current = requestAnimationFrame(updatePlayhead);
}, 50);
}
setTimeout(() => lucide.createIcons(), 50);