fix(midi): route MIDI live via masterBus, fix media explorer drag, add action logging

- TrackInstrument: gate native live path (SF/VSTi WASAPI bridge bypassed
  masterBus -> mastering FX + main out VU dead). Fallback to SonicSF WASM
  through masterBus.input; native kept for offline render only.
- MEDIA_LIBRARY_SAMPLES: rename MIDI_Loop_02_Bass/03_Lead/05_Bass to match
  actual /static/midi files (drag was 404 -> parse error).
- Add SonicAppLogger (console + POST /api/v1/logs) wired to: instrument load
  error, VSTi autosample fail, MIDI item -> mastering fx chain, play -> main
  out, drag MIDI errors (media explorer + window explorer).
- Add backend /api/v1/logs endpoint (server-side log, no DB).
This commit is contained in:
2026-08-11 21:48:06 +07:00
parent e3c9d6e4ab
commit 59cf77bcbc
7 changed files with 121 additions and 15 deletions
@@ -22,7 +22,15 @@ window.TrackInstrument = window.TrackInstrument || {};
// Loại engine native cho track: 'sf' (soundfont), 'vst3'/'vst2' (VSTi có
// plugin_id) hay null (không native được → fallback WASM/autosample).
// T15-regression fix: native live (SF/VSTi qua WASAPI bridge) phát thẳng ra
// OS device — BỎ QUA WebAudio masterBus → mastering FX + Main out VU không
// nhận tín hiệu. Gate native live path: luôn fallback WASM (SonicSF/
// autosample) qua masterBus.input. Native vẫn dùng cho OFFLINE render
// (scheduleNativeSfItem / /api/v1/native/render) — không đi qua hàm này.
// ponytail: re-enable live native khi C++ bridge có capture/readback →
// set window.__SONICFORGE_NATIVE_LIVE = true.
TrackInstrument.prototype._nativeKind = function () {
if (!window.__SONICFORGE_NATIVE_LIVE) return null;
try {
if (this.sfId) return 'sf';
if (window.SonicNativeAudio && this.synthEngine && this.synthEngine.plugin_id) {