feat(engine): fix SF2 path resolution, add synth_engine struct and fallback chain

- Fix SF2 path: search upload dir, system dir, static dir (backward compat)
- Add synth_engine struct parsing with flat field fallback
- Add 3-level fallback: selected SF -> default SF -> oscillator synth
- Write synth_engine in setTrackInstrument UI setters
- Pass synth_engine context to client SoundFontPlayer and AI gateway
This commit is contained in:
2026-07-26 16:49:40 +07:00
parent 2ab989132b
commit d48262d468
5 changed files with 99 additions and 22 deletions
+6
View File
@@ -1,3 +1,9 @@
### [2026-07-26 16:45] Task: Implement VST3/SoundFont engine plan
- **Tóm tắt thay đổi:** Fix SF2 path resolution (hardcoded → multi-dir scan), add `synth_engine` struct parsing in render & UI, 3-level fallback chain, pass context to client SoundFont player.
- **Các file ảnh hưởng:** `app/core/render_engine.py`, `app/static/js/app.jsx`, `app/static/js/services/soundfontPlayer.js`, `app/static/js/services/aiGateway.js`
- **Ghi chú/Test (nếu có):** Verified: catalog API returns 31 condensed instruments, render with flat fields + synth_engine struct + drums (bank=128) + missing SF fallback all succeed.
---
### [2026-07-25 06:57] Task: Fix Piano Roll runtime errors (rollBeats TDZ + handleCCMouseMove)
- **Tóm tắt thay đổi:** Sửa lỗi `Cannot access 'rollBeats' before initialization` bằng cách di chuyển khai báo `rollBeats`/`rollBeatsRef` lên trước `totalBeats`. Thêm hàm `handleCCMouseMove` bị thiếu và cập nhật `handleCCMouseDown` hỗ trợ Ctrl+Click paint velocity.
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`