fix: section track plays GM Piano via program default 0

section cloned tracks have instrumentProgram:undefined.
Line 10283 defaulted to 0 -> FluidSynth program_change(ch,0)
-> plays whatever SoundFont is loaded (MAIN SF).
Added _isSectionClone flag; line 10283 skips program default
for section clones -> undefined -> _playNoteFluid silent return.
This commit is contained in:
2026-07-28 09:30:27 +07:00
parent 6fa6578dd1
commit 43691a127e
3 changed files with 13 additions and 5 deletions
+5 -3
View File
@@ -8505,7 +8505,8 @@ const App = () => {
monitoringEnabled: true,
instrumentId: t.instrumentId || null,
instrumentProgram: t.instrumentProgram,
instrumentName: t.instrumentName || null
instrumentName: t.instrumentName || null,
_isSectionClone: true
})) : tracks.filter(t => t.id === trackId).map(t => ({
...t,
clips: [],
@@ -8521,7 +8522,8 @@ const App = () => {
soundfont_bank: undefined,
soundfont_program: undefined,
instrument_source: null,
synth_engine: undefined
synth_engine: undefined,
_isSectionClone: true
}));
setSessionTabs(prev => [...prev, { id: tabId, name: tabName, sectionId: sectionId, tracks: clonedTracks, color: section.color || null }]);
setActiveTab(tabId);
@@ -10280,7 +10282,7 @@ const App = () => {
const noteEndSec = noteStartSec + noteDurSec;
if (offsetTime < noteEndSec) {
const durationMs = noteDurSec * 1000;
const program = track.instrumentProgram !== undefined ? track.instrumentProgram : 0;
const program = track._isSectionClone ? track.instrumentProgram : (track.instrumentProgram !== undefined ? track.instrumentProgram : 0);
if (offsetTime < noteStartSec) {
const delay = noteStartSec - offsetTime;
const startTime = context.currentTime + delay;
File diff suppressed because one or more lines are too long
+6
View File
@@ -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:30] Task: Thêm _isSectionClone flag — tắt âm thanh mặc định trong SECTION-TAB
- **Tóm tắt thay đổi:** Thêm `_isSectionClone: true` vào section cloned tracks. Line 10283 kiểm tra flag: nếu section clone và không instrument → `undefined` (silent); nếu MAIN track và không instrument → `0` (GM Piano). Trước đây section cloned tracks đi qua line 10283 với `instrumentProgram: undefined` → default 0 → play GM Piano.
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
- **Ghi chú/Test (nếu có):** `npm run build` pass. SECTION-TAB không instrument → im lặng. MAIN track không instrument → GM Piano.
---
### [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`