fix: ReferenceError assignTrackMidiChannel - chuyển allocator channel lên module-level cho PianoRollTabEditor + bật AudioWorklet thay ScriptProcessor

This commit is contained in:
2026-08-03 11:17:19 +07:00
parent 0182abf7ea
commit 47b1633bd3
5 changed files with 51 additions and 38 deletions
+4 -2
View File
@@ -86,14 +86,16 @@
console.log("[SonicSF] AudioCtx state:", _audioCtx.state, "sampleRate:", _audioCtx.sampleRate);
var _useScriptNode = true;
// Prefer the AudioWorklet (fluidsynth-bridge) — ScriptProcessor
// is deprecated and logs a console warning. Fall back to
// ScriptProcessor only if the worklet cannot be created.
var _useScriptNode = false;
try {
await _audioCtx.audioWorklet.addModule('/static/js/worklets/fluidsynth-bridge.js');
console.log("[SonicSF] Worklet registered OK");
} catch (e) {
console.warn("[SonicSF] Worklet reg failed:", e);
}
console.log("[SonicSF] Using ScriptProcessorNode (forced for debug)");
console.log("[SonicSF] Initializing FluidSynth WASM Engine...");
var TOTAL_MEMORY = 256 * 1024 * 1024;