From 90ff65f31de5fd7a6c46e09000a2fcedba5c044e Mon Sep 17 00:00:00 2001 From: 3dtours Date: Mon, 27 Jul 2026 11:14:09 +0700 Subject: [PATCH] fix: add debug log to stopNote for troubleshooting --- app/static/js/services/soundfontPlayer.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index 0ee05eb..b44d2ad 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -163,8 +163,14 @@ stopNote: function (channel, pitch) { if (channel < 0 || channel > 15) return; + console.log("[SonicSF] stopNote ch=" + channel + " pitch=" + pitch + " init=" + _initialized); if (_initialized && _synthInstance) { - try { _synthInstance.noteOff(channel, pitch); } catch (e) {} + try { _synthInstance.noteOff(channel, pitch); } catch (e) { + console.warn("[SonicSF] noteOff threw:", e); + } + } else { + // Oscillator fallback: stop is handled by the 60000ms timeout + // Nothing to do — oscillator auto-stops after durationMs } },