tentando resolver conflitos do tone no mmpCreator
Deploy / Deploy (push) Successful in 2m1s
Details
Deploy / Deploy (push) Successful in 2m1s
Details
This commit is contained in:
parent
2fa137a45d
commit
191e97d032
|
|
@ -14,7 +14,7 @@ import { renderAll, getSamplePathMap } from "./ui.js";
|
||||||
import { DEFAULT_PAN, DEFAULT_VOLUME, NOTE_LENGTH } from "./config.js";
|
import { DEFAULT_PAN, DEFAULT_VOLUME, NOTE_LENGTH } from "./config.js";
|
||||||
import { initializeAudioContext, getMainGainNode } from "./audio.js";
|
import { initializeAudioContext, getMainGainNode } from "./audio.js";
|
||||||
import { DEFAULT_PROJECT_XML, getSecondsPerStep, SAMPLE_SRC } from "./utils.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";
|
import { sendAction } from "./socket.js";
|
||||||
|
|
||||||
// ⚠️ vem do módulo de áudio (o mesmo que audio_ui usa)
|
// ⚠️ 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;
|
const lanePan = st ? Number(st.getAttribute("pan") ?? 0) / 100 : 0;
|
||||||
|
|
||||||
// cada <sampletco> é um clip
|
// 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) => {
|
clips.forEach((c, cidx) => {
|
||||||
// resolve caminho via manifest; fallback para /samples
|
// resolve caminho via manifest; fallback para /samples
|
||||||
const src = c.getAttribute("src") || "";
|
const src = c.getAttribute("src") || "";
|
||||||
|
|
@ -509,9 +509,9 @@ export async function parseMmpContent(xmlString) {
|
||||||
.map((trackNode, idx) => {
|
.map((trackNode, idx) => {
|
||||||
const trackName = trackNode.getAttribute("name") || "Beat/Bassline";
|
const trackName = trackNode.getAttribute("name") || "Beat/Bassline";
|
||||||
|
|
||||||
const playlistClips = Array.from(trackNode.children)
|
const playlistClips = Array.from(
|
||||||
.filter(c => c.tagName === "bbtco")
|
trackNode.querySelectorAll(":scope > bbtco")
|
||||||
.map((bbtco) => ({
|
).map((bbtco) => ({
|
||||||
pos: parseInt(bbtco.getAttribute("pos"), 10) || 0,
|
pos: parseInt(bbtco.getAttribute("pos"), 10) || 0,
|
||||||
len: parseInt(bbtco.getAttribute("len"), 10) || 192,
|
len: parseInt(bbtco.getAttribute("len"), 10) || 192,
|
||||||
name: trackName,
|
name: trackName,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// js/pattern_audio.js
|
// js/pattern_audio.js
|
||||||
import * as Tone from "https://esm.sh/tone@14.7.77";
|
import * as Tone from "https://esm.sh/tone";
|
||||||
|
|
||||||
import { appState } from "../state.js";
|
import { appState } from "../state.js";
|
||||||
import { highlightStep } from "./pattern_ui.js";
|
import { highlightStep } from "./pattern_ui.js";
|
||||||
|
|
@ -632,13 +632,7 @@ export function startSongPatternPlaybackOnTransport() {
|
||||||
if (patt.steps[stepInPattern]) {
|
if (patt.steps[stepInPattern]) {
|
||||||
if (track.type === "sampler" && track.player) {
|
if (track.type === "sampler" && track.player) {
|
||||||
track.player.restart = true;
|
track.player.restart = true;
|
||||||
try {
|
try { track.player.start(time); } catch {}
|
||||||
// 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) {
|
} else if (track.type === "plugin" && track.instrument) {
|
||||||
// plugin sem piano roll
|
// plugin sem piano roll
|
||||||
try { track.instrument.triggerAttackRelease("C5", "16n", time); } catch {}
|
try { track.instrument.triggerAttackRelease("C5", "16n", time); } catch {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue