From 48e4047a84d528dac1ceffd33668ce3bd4ada0e9 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Mon, 27 Jul 2026 11:27:39 +0700 Subject: [PATCH] revert: remove 100ms delay from stopNote, keep instant noteOff --- app/static/js/services/soundfontPlayer.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index f3b1f41..c1a7759 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -163,13 +163,10 @@ stopNote: function (channel, pitch) { if (channel < 0 || channel > 15) return; - if (!_initialized || !_synthInstance) return; - // Delay noteOff by 100ms for natural release - const timer = setTimeout(() => { + if (_initialized && _synthInstance) { try { _synthInstance.noteOff(channel, pitch); } catch (e) {} try { _synthInstance.noteOff(channel, pitch, 0); } catch (e) {} - }, 100); - _scheduledNotes.push({ on: null, off: timer }); + } }, playNote: function (note, velocity, durationMs, startTime, program, destinationNode, channel, synthEngine) {