fix: SF2 bank select, midi multi-key cut, VSTi reopen hang, multi-track stuck

- NativeInstrumentEngine: track GM bank per channel (CC0/CC32), use bank in programChange
- app.jsx: send CC0/CC32+PROGRAM before notes via __ensureBridgeProgram, dedupe, clear dedupe after async LOAD
- audioRoutingEngine/bridgeAudioNode: idempotent connect (no disconnect-flush on re-connect), fixes note cut & multi-track stuck
- main.cpp: remove 10s poll in OPEN_GUI control job (blocked realtime loop, watchdog race), VstWindowProc stores channel not inst pointer, cleanup gui maps on WM_DESTROY
This commit is contained in:
2026-08-13 12:19:34 +07:00
parent d168328004
commit 3f59c2c4c2
7 changed files with 136 additions and 50 deletions
+9 -1
View File
@@ -12,6 +12,7 @@
var _gainNode = null;
var _ctx = null;
var _initialized = false;
var _dest = null; // destination gain node da noi (chong connect trung)
function _getCtx() {
if (_ctx) return _ctx;
@@ -78,6 +79,7 @@
_spn = null;
_gainNode = null;
_ctx = null;
_dest = null;
}
window.BridgeAudioNode = {
@@ -85,7 +87,13 @@
onAudio: onAudio,
flush: flush,
getOutputNode: getOutputNode,
connect: function (dest) { if (_gainNode) _gainNode.connect(dest); },
connect: function (dest) {
if (!_gainNode) return;
if (_dest === dest) return; // da noi — khong noi trung (double-sum)
if (_dest) { try { _gainNode.disconnect(_dest); } catch (e) {} }
_gainNode.connect(dest);
_dest = dest;
},
disconnect: disconnect,
isReady: function () { return _initialized; }
};