diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index 7931443..95543ab 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -393,12 +393,7 @@ _fluidModule._fluid_synth_program_change(_synthPtr, ch, usedProg); } catch (e) {} } else { - // No instrument configured: use oscillator fallback directly. - // Do NOT call program_change(ch, 0) — FluidSynth would pick - // program 0 from whatever SoundFont is loaded (could be - // another track's SF), causing cross-track instrument leak. - var ctx = getCtx(); - self._playNoteFallback(note, velocity, durationMs, startTime, undefined, null, channel, undefined); + // No instrument configured: silent — no FluidSynth, no oscillator. return; } if (ch === undefined) ch = (usedBank === 128 ? 9 : 0); diff --git a/wiki.md b/wiki.md index 4344226..a3a6e75 100644 --- a/wiki.md +++ b/wiki.md @@ -539,6 +539,12 @@ - **Ghi chú/Test (nếu có):** `npm run build` pass. Ctrl+Click+Drag section/MIDI item → copy đến vị trí mới, item không bị selected. --- +### [2026-07-28 09:27] Task: Silent fallback — không nghe âm thanh mặc định +- **Tóm tắt thay đổi:** Thay oscillator fallback bằng silent return trong `_playNoteFluid` (soundfontPlayer.js:395). Khi không có instrument data, không play bất kỳ âm thanh nào (cả oscillator lẫn FluidSynth). +- **Các file ảnh hưởng:** `app/static/js/services/soundfontPlayer.js` +- **Ghi chú/Test (nếu có):** Section sub-track MIDI items không instrument → im lặng. MAIN track MIDI items không instrument → GM Piano (program 0). +--- + ### [2026-07-28 09:25] Task: Restore program default 0 cho MAIN track MIDI playback - **Tóm tắt thay đổi:** Restore line 10283 `instrumentProgram !== undefined ? instrumentProgram : 0` — MAIN track MIDI items cần program 0 để play (GM Piano) khi không load instrument. Chỉ section sub-track (line 10393) giữ `subTrack.instrumentProgram` (undefined → oscillator fallback) để tránh load MAIN SoundFont. - **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`