Add VST2 hosting to native bridge; fix CC7 data2 routing verified via SHM test
VST2 (Steinberg 2.4 ABI) host via Vst2Instrument: aeffect.h, dispatcher, process events/replacing, kEffectStartProcess, headless GUI skip. - create_instrument returns Vst2Instrument for InstrumentType::VST2 - 64B-aligned scratch buffers for SIMD plugins; SEH crash capture module+stack - plugins.py: VST2 resolves .dll/.so; vst_engine.py reports VST2 type - app.jsx: derive instrumentType from scan (VST3 vs VST2), not hardcoded - Install exes refreshed from Release build SF2 FluidSynth audio verified end-to-end through SHM ring (energy 1.33): silence was a test-harness bug (CC7 value written to velocity field, bridge reads data2) — app sends data2 correctly. All temporary diagnostics removed.
This commit is contained in:
+15
-4
@@ -6382,9 +6382,16 @@ const loadVstToBridge = async (track) => {
|
||||
// V8 bug 5: engine _resolve_bridge_asset chi match FILE theo filename —
|
||||
// KHONG walk folder VST3 ("X.vst3/X.vst3.dll") → 404. Dung path da luu
|
||||
// (synth_engine.plugin_path) hoac cache tu listPlugins.
|
||||
// VST2 (.dll) scan type 'VST2' - khong hardcode VST3 (se LOAD sai loai).
|
||||
let btype = 'VST3';
|
||||
let knownPath = track.synth_engine && track.synth_engine.plugin_path;
|
||||
if (!knownPath && window.__bridgePluginPaths) knownPath = window.__bridgePluginPaths[instrumentId];
|
||||
const r = await window.SonicAPI.bridgeLoad({ name: instrumentId, path: knownPath || null, instrumentType: 'VST3', channel: bch });
|
||||
if (instrumentSelectorData) {
|
||||
const v0 = (instrumentSelectorData.vst_instruments || []).find(v => v.id === instrumentId || v.name === instrumentId);
|
||||
if (v0 && v0.path) knownPath = v0.path;
|
||||
if (v0 && v0.type) btype = v0.type;
|
||||
}
|
||||
const r = await window.SonicAPI.bridgeLoad({ name: instrumentId, path: knownPath || null, instrumentType: btype, channel: bch });
|
||||
let p = r && r.path ? r.path : null;
|
||||
if (!p && knownPath) p = knownPath;
|
||||
if (!p && window.SonicAPI.listPlugins) {
|
||||
@@ -6393,15 +6400,16 @@ const loadVstToBridge = async (track) => {
|
||||
const v = ((pl && pl.vst_instruments) || []).find(x => x.id === instrumentId || x.name === instrumentId);
|
||||
if (v && v.path) {
|
||||
p = v.path;
|
||||
if (v && v.type) btype = v.type;
|
||||
if (!window.__bridgePluginPaths) window.__bridgePluginPaths = {};
|
||||
window.__bridgePluginPaths[instrumentId] = v.path;
|
||||
}
|
||||
} catch (e2) { console.warn('[Bridge] listPlugins fallback fail:', e2); }
|
||||
}
|
||||
if (!p) return false;
|
||||
const ok = await window.NativeBridgeService.loadInstrument(p, 'VST3', bch);
|
||||
const ok = await window.NativeBridgeService.loadInstrument(p, btype, bch);
|
||||
if (ok) window.__bridgeLoadedChannels[bch] = true;
|
||||
console.log('[Bridge] auto-load track', track.id, '-> VST3 ch', bch, ok ? 'OK' : 'FAIL', p);
|
||||
console.log('[Bridge] auto-load track', track.id, '->', btype, 'ch', bch, ok ? 'OK' : 'FAIL', p);
|
||||
return !!ok;
|
||||
} catch (e) { console.warn('[Bridge] loadVstToBridge fail:', track.id, e); return false; }
|
||||
};
|
||||
@@ -15753,7 +15761,9 @@ const App = () => {
|
||||
// (flag cũ còn true) → OPEN_GUI đến bridge khi channel chưa có instrument
|
||||
// → deferred mãi, nút GUI không mở gì.
|
||||
if (isSf && window.__bridgeLoadedChannels) delete window.__bridgeLoadedChannels[bch];
|
||||
const btype = isSf ? 'SF2' : 'VST3';
|
||||
// VST2 (.dll) scan type la 'VST2' - khong hardcode VST3 (se LOAD sai
|
||||
// loai -> create_instrument nullptr -> fail im lang).
|
||||
let btype = isSf ? 'SF2' : 'VST3';
|
||||
let bpath = null;
|
||||
if (instrumentSelectorData) {
|
||||
if (isSf) {
|
||||
@@ -15763,6 +15773,7 @@ const App = () => {
|
||||
} else {
|
||||
const v0 = (instrumentSelectorData.vst_instruments || []).find(v => v.id === instrumentId || v.name === instrumentId);
|
||||
bpath = v0 && v0.path;
|
||||
if (v0 && v0.type) btype = v0.type;
|
||||
}
|
||||
}
|
||||
(async () => {
|
||||
|
||||
Reference in New Issue
Block a user