tentando resolver conflitos do tone no mmpCreator
Deploy / Deploy (push) Successful in 2m26s Details

This commit is contained in:
JotaChina 2025-12-26 19:47:54 -03:00
parent 8bccf7ea4d
commit bf060929c6
6 changed files with 13 additions and 8 deletions

View File

@ -17,7 +17,7 @@ import {
import { getPixelsPerSecond } from "../utils.js";
// 🔊 ADIÇÃO: usar a MESMA instância do Tone que o projeto usa
import * as Tone from "https://esm.sh/tone";
import * as Tone from "https://esm.sh/tone@14.7.77";
// --- Configurações do Scheduler ---
const LOOKAHEAD_INTERVAL_MS = 25.0;

View File

@ -2,7 +2,7 @@
import { DEFAULT_VOLUME, DEFAULT_PAN } from "../config.js";
import { renderAudioEditor } from "./audio_ui.js";
import { getMainGainNode, getAudioContext } from "../audio.js";
import * as Tone from "https://esm.sh/tone";
import * as Tone from "https://esm.sh/tone@14.7.77";
export let audioState = {
tracks: [],

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)

View File

@ -20,7 +20,7 @@ import { sendAction, joinRoom, setUserName } from "./socket.js";
import { renderActivePatternToBlob } from "./pattern/pattern_audio.js";
import { showToast } from "./ui.js";
import { toggleRecording } from "./recording.js"
import * as Tone from "https://esm.sh/tone"; // Adicione o Tone aqui se não estiver global
import * as Tone from "https://esm.sh/tone@14.7.77";
const ROOM_NAME = new URLSearchParams(window.location.search).get("room");
window.ROOM_NAME = ROOM_NAME;

View File

@ -1,12 +1,11 @@
// 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";
import { getTotalSteps } from "../utils.js";
import { initializeAudioContext } from "../audio.js";
// Ajuste os caminhos (../plugins/...) conforme a estrutura real das suas pastas
import { TripleOscillator } from "../../audio/plugins/TripleOscillator.js";
import { Nes } from "../../audio/plugins/Nes.js";
import { SuperSaw } from "../../audio/plugins/SuperSaw.js";
@ -633,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 {}

View File

@ -1,5 +1,5 @@
// js/pattern/pattern_state.js
import * as Tone from "https://esm.sh/tone";
import * as Tone from "https://esm.sh/tone@14.7.77";
import { TripleOscillator } from "../../audio/plugins/TripleOscillator.js";
import { Kicker } from "../../audio/plugins/Kicker.js";
import { Lb302 } from "../../audio/plugins/Lb302.js";