tentando resolver conflitos do tone no mmpCreator

This commit is contained in:
JotaChina committed 2025-12-26 20:04:50 -03:00
1 parent 0710f3c140
commit 6be57ae802
2 files changed
+9 -3

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ import { renderAll, getSamplePathMap } from "./ui.js";
import { DEFAULT_PAN, DEFAULT_VOLUME, NOTE_LENGTH } from "./config.js";
import { initializeAudioContext, getMainGainNode } from "./audio.js";
import { DEFAULT_PROJECT_XML, getSecondsPerStep, SAMPLE_SRC } from "./utils.js";
import * as Tone from "https://esm.sh/tone";
import * as Tone from "https://esm.sh/tone@14.7.77";
import { sendAction } from "./socket.js";
// ⚠️ vem do módulo de áudio (o mesmo que audio_ui usa)
+8 -2
View File
@@ -1,5 +1,5 @@
// js/pattern_audio.js
import * as Tone from "https://esm.sh/tone";
import * as Tone from "https://esm.sh/tone@14.7.77";
import { appState } from "../state.js";
import { highlightStep } from "./pattern_ui.js";
@@ -632,7 +632,13 @@ export function startSongPatternPlaybackOnTransport() {
if (patt.steps[stepInPattern]) {
if (track.type === "sampler" && track.player) {
track.player.restart = true;
try { track.player.start(time); } catch {}
try {
// Verifica se já está tocando. Se sim, para imediatamente antes de recomeçar.
if (track.player.state === "started") {
track.player.stop();
}
track.player.start(time); }
catch {}
} else if (track.type === "plugin" && track.instrument) {
// plugin sem piano roll
try { track.instrument.triggerAttackRelease("C5", "16n", time); } catch {}