tentando resolver conflitos do tone no mmpCreator

This commit is contained in:
JotaChina committed 2025-12-26 20:00:10 -03:00
1 parent ee49f1c9ff
commit 0710f3c140
2 files changed
+7 -13

No files matched your search

+5 -5
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@14.7.77";
import * as Tone from "https://esm.sh/tone";
import { sendAction } from "./socket.js";
// ⚠️ vem do módulo de áudio (o mesmo que audio_ui usa)
@@ -414,7 +414,7 @@ export async function parseMmpContent(xmlString) {
const lanePan = st ? Number(st.getAttribute("pan") ?? 0) / 100 : 0;
// cada <sampletco> é um clip
const clips = Array.from(node.children).filter(c => c.tagName === "sampletco");
const clips = Array.from(node.querySelectorAll(":scope > sampletco"));
clips.forEach((c, cidx) => {
// resolve caminho via manifest; fallback para /samples
const src = c.getAttribute("src") || "";
@@ -509,9 +509,9 @@ export async function parseMmpContent(xmlString) {
.map((trackNode, idx) => {
const trackName = trackNode.getAttribute("name") || "Beat/Bassline";
const playlistClips = Array.from(trackNode.children)
.filter(c => c.tagName === "bbtco")
.map((bbtco) => ({
const playlistClips = Array.from(
trackNode.querySelectorAll(":scope > bbtco")
).map((bbtco) => ({
pos: parseInt(bbtco.getAttribute("pos"), 10) || 0,
len: parseInt(bbtco.getAttribute("len"), 10) || 192,
name: trackName,