tentando resolver conflitos do tone no mmpCreator
Deploy / Deploy (push) Successful in 1m59s Details

This commit is contained in:
JotaChina 2025-12-26 20:51:53 -03:00
parent f847d92aa6
commit 2ce14a5f02
1 changed files with 7 additions and 2 deletions

View File

@ -583,7 +583,12 @@ export function startSongPatternPlaybackOnTransport() {
const stepIntervalSec = 60 / (bpm * 4); const stepIntervalSec = 60 / (bpm * 4);
// step absoluto do song (considera seek do Transport) // step absoluto do song (considera seek do Transport)
const songStep = Math.floor(Tone.Transport.seconds / stepIntervalSec + 1e-6); const transportSec = Tone.Transport.getSecondsAtTime
? Tone.Transport.getSecondsAtTime(time)
: Tone.Transport.seconds;
const songStep = Math.floor(transportSec / stepIntervalSec + 1e-6);
const songTick = songStep * LMMS_TICKS_PER_STEP; const songTick = songStep * LMMS_TICKS_PER_STEP;
// quais patterns (colunas) estão ativas neste tick? // quais patterns (colunas) estão ativas neste tick?
@ -660,7 +665,7 @@ export function startSongPatternPlaybackOnTransport() {
try { try {
// Verifica se já está tocando. Se sim, para imediatamente antes de recomeçar. // Verifica se já está tocando. Se sim, para imediatamente antes de recomeçar.
if (track.player.state === "started") { if (track.player.state === "started") {
track.player.stop(); track.player.stop(time);
} }
track.player.start(time); } track.player.start(time); }
catch {} catch {}