feat: silent fallback when no instrument — no oscillator default
_playNoteFluid no-instrument branch previously called _playNoteFallback (sine wave oscillator). Changed to silent return. User explicitly requested no default sound.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user