From 838e173dd75e8b8ffb98f9331124044aa81c53a4 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Mon, 27 Jul 2026 15:56:28 +0700 Subject: [PATCH] debug: log _playNoteFluid params + stopNote activeNotes keys --- app/static/js/services/soundfontPlayer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index 281b7b3..d976037 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -320,9 +320,11 @@ stopNote: function (channel, pitch) { if (channel < 0 || channel > 15) return; if (_initialized && _fluidModule) { - var mappedCh = _activeNotes[channel + ':' + pitch]; + var key = channel + ':' + pitch; + var mappedCh = _activeNotes[key]; + console.log("[SonicSF] stopNote ch:", channel, "pitch:", pitch, "key:", key, "mappedCh:", mappedCh, "activeKeys:", Object.keys(_activeNotes)); if (mappedCh === undefined) mappedCh = channel; - delete _activeNotes[channel + ':' + pitch]; + delete _activeNotes[key]; try { var r1 = _fluidModule._fluid_synth_noteoff(_synthPtr, mappedCh, pitch); if (r1 !== 0) { @@ -352,6 +354,7 @@ }, _playNoteFluid: function (note, velocity, durationMs, startTime, program, channel, synthEngine) { + console.log("[SonicSF] _playNoteFluid chParam:", channel, "synthEngine:", synthEngine ? synthEngine.soundfont_id + ':' + synthEngine.soundfont_bank + ':' + synthEngine.soundfont_program : 'null'); var midiPitch = Math.min(127, Math.max(0, parseInt(note) || 60)); var midiVel = Math.min(127, Math.max(1, Math.floor( typeof velocity === 'number' ? (velocity > 1 ? velocity : velocity * 127) : 100