FIX: sửa lỗi không load soundfont trên window, MIDI item không play được qua carla
This commit is contained in:
@@ -75,6 +75,16 @@ window.SonicCarlaMidi = window.SonicCarlaMidi || {
|
||||
return String(se.type || '').indexOf('vst') !== -1 && !!se.plugin_id;
|
||||
} catch (e) { return false; }
|
||||
},
|
||||
// Playback MIDI items: route khi track VSTi + Carla local (không cần ARM —
|
||||
// user đã chủ động bấm Play trên item đó).
|
||||
shouldRoutePlayback: function (synthEngine) {
|
||||
try {
|
||||
var c = window.SonicRuntime && window.SonicRuntime.capabilities;
|
||||
if (!c || !c.features || !c.features.carla_local) return false;
|
||||
var se = synthEngine || {};
|
||||
return String(se.type || '').indexOf('vst') !== -1 && !!se.plugin_id;
|
||||
} catch (e) { return false; }
|
||||
},
|
||||
noteOn: function (channel, note, velocity) {
|
||||
if (!window.SonicAPI || !window.SonicAPI.carlaMidi) return;
|
||||
window.SonicAPI.carlaMidi({ event: 'note_on', note: note, velocity: velocity || 100, channel: channel || 0 }).catch(function () {});
|
||||
|
||||
Reference in New Issue
Block a user