fix: section sub-track MIDI default program 0 loads MAIN SoundFont

Line 10393 defaulted program to 0 when subTrack.instrumentProgram
was undefined (section clone with no instrument). _playNoteFluid
receives program=0, calls program_change(ch,0) on FluidSynth,
which picks program 0 from whatever SoundFont is loaded (MAIN
session's SF). Fix: pass undefined -> _playNoteFluid takes
oscillator fallback, no SoundFont loading.
This commit is contained in:
2026-07-28 09:10:33 +07:00
parent 9c2fa52e1b
commit 52ec9379d6
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -10390,7 +10390,7 @@ const App = () => {
// Only play if the note starts inside the Section item bounds and hasn't finished yet
if (noteStartMain >= secStart && noteStartMain < secEnd && offsetTime < noteEndMain) {
const notePlayEndMain = Math.min(noteEndMain, secEnd);
const program = subTrack.instrumentProgram !== undefined ? subTrack.instrumentProgram : 0;
const program = subTrack.instrumentProgram;
var subCh = window.SonicPianoRoll ? window.SonicPianoRoll.getTrackMidiChannel(subTrack, secTracks) : (subTrack.midiChannel !== undefined ? subTrack.midiChannel : (subIdx % 16));
if (offsetTime < noteStartMain) {