diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index b2ecae9..7931443 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -393,10 +393,13 @@ _fluidModule._fluid_synth_program_change(_synthPtr, ch, usedProg); } catch (e) {} } else { - if (ch === undefined) ch = 0; - try { - _fluidModule._fluid_synth_program_change(_synthPtr, ch, 0); - } catch (e) {} + // 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); + return; } if (ch === undefined) ch = (usedBank === 128 ? 9 : 0); var ctx = getCtx();