tentando resolver conflitos do tone no mmpCreator
This commit is contained in:
1 parent
6e5ba6a089
commit
44d8250efb
1 file changed
+7
-2
@@ -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 {}
|
||||||
|
|||||||
Reference in new issue
Block a user