From 57235e68d2b6820258816d70dd6489a73743adc9 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Mon, 27 Jul 2026 16:16:00 +0700 Subject: [PATCH] docs: wiki entry program_select fix --- wiki.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wiki.md b/wiki.md index 311e9a3..f270ee8 100644 --- a/wiki.md +++ b/wiki.md @@ -445,6 +445,12 @@ - **Ghi chú/Test (nếu có):** ARM 2 track cùng SF khác instrument → cả 2 play. Đổi SF → noteOff vẫn tìm đúng voice. --- +### [2026-07-27 16:05] Fix: program_select thay bank_select+program_change (SF preset search order) +- **Tóm tắt thay đổi:** `bank_select` + `program_change` dùng search order qua tất cả SF đã load. Khi track 1 load SF2, preset lookup trên channel 0 tìm thấy preset của SF2 thay vì SF1 (SF2 là last-loaded → priority). Fix: `fluid_synth_program_select(synth, ch, sfHandle, bank, prog)` chỉ định rõ SoundFont ID, không phụ thuộc search order. Track 2 giữ nguyên instrument của SF1. +- **Các file ảnh hưởng:** `soundfontPlayer.js` +- **Ghi chú/Test (nếu có):** Track 1 SF1→SF2, track 2 SF1 → track 2 không bị ảnh hưởng. +--- + ### [2026-07-27 12:15] Task: Fix SpessaSynth loop voice not releasing (layer 2) - **Tóm tắt thay đổi:** CC 120 vẫn không đủ vì SpessaSynth 4.3.1 AudioWorklet có bug: looped voices trong MIDI message pipeline xử lý CC 120 sai (`processMessage`). Fix: thêm `noteOn(ch, pitch, 0)` (MIDI noteOff alternate path) + `_synthInstance.post({channelNumber:ch, type:"stopAll", data:1})` gửi lệnh trực tiếp đến worklet qua `handleMessage` — bypass hoàn toàn MIDI pipeline. - **Các file ảnh hưởng:** `app/static/js/services/soundfontPlayer.js`, `app/templates/index.html`