connect solution into app: VSTi live native (vst3 attach/vst2 bridge) with WASM autosample fallback, VST GUI window (Bug 1), native-first track instrument
This commit is contained in:
@@ -58,16 +58,30 @@ window.SonicNativeAudio = window.SonicNativeAudio || {};
|
||||
console.warn('[NativeAudio] sf/ensure:', e.message);
|
||||
});
|
||||
},
|
||||
ensureVst2: function (trackId, pluginId, pluginPath) {
|
||||
return post('/vst2/ensure', { track_id: trackId, plugin_id: pluginId || null, plugin_path: pluginPath || null, live: true }).catch(function (e) {
|
||||
console.warn('[NativeAudio] vst2/ensure:', e.message);
|
||||
});
|
||||
},
|
||||
ensureVst3: function (trackId, pluginId, pluginPath) {
|
||||
return post('/vst3/ensure', { track_id: trackId, plugin_id: pluginId || null, plugin_path: pluginPath || null, live: true }).catch(function (e) {
|
||||
console.warn('[NativeAudio] vst3/ensure:', e.message);
|
||||
});
|
||||
},
|
||||
noteOn: function (kind, trackId, channel, pitch, velocity) {
|
||||
var path = kind === 'vst2' ? '/vst2/note_on' : '/sf/note_on';
|
||||
var path = kind === 'vst2' ? '/vst2/note_on' : (kind === 'vst3' ? '/vst3/note_on' : '/sf/note_on');
|
||||
// Rethrow sau warn: TrackInstrument can fallback autosample/WASM
|
||||
// khi native khong san sang (DLL/plugin loi).
|
||||
return post(path, { track_id: trackId, channel: channel || 0, pitch: pitch, velocity: velocity != null ? velocity : 100 }).catch(function (e) {
|
||||
console.warn('[NativeAudio] note_on:', e.message);
|
||||
throw e;
|
||||
});
|
||||
},
|
||||
noteOff: function (kind, trackId, channel, pitch) {
|
||||
var path = kind === 'vst2' ? '/vst2/note_off' : '/sf/note_off';
|
||||
var path = kind === 'vst2' ? '/vst2/note_off' : (kind === 'vst3' ? '/vst3/note_off' : '/sf/note_off');
|
||||
return post(path, { track_id: trackId, channel: channel || 0, pitch: pitch }).catch(function (e) {
|
||||
console.warn('[NativeAudio] note_off:', e.message);
|
||||
throw e;
|
||||
});
|
||||
},
|
||||
sfAudioStop: function (trackId) {
|
||||
|
||||
Reference in New Issue
Block a user