FIX: sửa lỗi MIDI item với fx mastering tồn tại và không qua Carla

This commit is contained in:
2026-08-10 17:48:38 +07:00
parent a1dc074e35
commit 67ad2b8e4b
3 changed files with 83 additions and 15 deletions
+22
View File
@@ -231,3 +231,25 @@ plugin/preset** (khác "Preview Synth WASM" cũ — âm giả).
- [ ] Docker (`SF_DOCKER=1`): capabilities `runtime=headless`, không hiện Carla Bridge, preset upload hoạt động, render VSTi Linux + soundfont từ mount OK
- [ ] `SF_RUNTIME=desktop` trên Linux có DISPLAY → chạy như desktop
- [ ] pytest: `86 passed, 7 skipped`
## 9. Flow MIDI Keyboard hardware (Web MIDI) — route đầy đủ
Hardware MIDI keyboard (Web MIDI API) đi qua ĐÚNG flow như keybed ảo:
```
MIDI Keyboard (hardware, Web MIDI)
├─ note-on → ensureMasteringRouting() (ép âm qua Mastering FX Chain khi bật)
│ → SonicSF.playNote() (track soundfont/GM — qua track node → mastering)
│ → SonicCarlaMidi.noteOn() (track VSTi + ARM + Carla local — OSC /Carla/0/note_on)
├─ note-off → SonicSF.stopNote() (dừng soundfont)
│ → SonicCarlaMidi.noteOff() (dừng VSTi trong Carla — tránh kẹt âm)
└─ CC64/CC1/Pitch Bend → SonicSF.controllerChange()/pitchBend() (armed tracks)
```
Trước đây chỉ keybed ảo (piano roll) gọi `SonicCarlaMidi` + `__ensureMasteringRouting`;
keyboard hardware bị bỏ sót → track VSTi không kêu khi bấm đàn thật, và âm soundfont
không qua mastering cho tới khi bật/tắt power. Đã sửa tại `onmidimessage` handler
(`app.jsx`): note-on/note-off route qua Carla bridge + ép đồng bộ mastering routing.
Export offline (`clientSideExport`) cũng áp **Main out volume** (master fader) vào
offline master bus — file WAV đúng độ lớn nghe được (trước đây luôn 1.0).