From 8965643450cf3e124c8e5af50b5025d685158e86 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Mon, 27 Jul 2026 16:00:33 +0700 Subject: [PATCH] =?UTF-8?q?cleanup:=20b=E1=BB=8F=20dead=20code=20stopNote?= =?UTF-8?q?=20+=20debug=20log=20=5FplayNoteFluid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/services/soundfontPlayer.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js index 3dbea9b..e236623 100644 --- a/app/static/js/services/soundfontPlayer.js +++ b/app/static/js/services/soundfontPlayer.js @@ -322,21 +322,11 @@ if (_initialized && _fluidModule) { var key = channel + ':' + pitch; var mappedChs = _activeNotes[key]; - if (mappedChs === undefined) { - if (_activeNotes['_' + key]) mappedChs = _activeNotes['_' + key]; - } if (mappedChs === undefined) mappedChs = [channel]; - if (!Array.isArray(mappedChs)) mappedChs = [mappedChs]; for (var i = 0; i < mappedChs.length; i++) { try { _fluidModule._fluid_synth_noteoff(_synthPtr, mappedChs[i], pitch); } catch (e) {} } delete _activeNotes[key]; - try { - var r1 = _fluidModule._fluid_synth_noteoff(_synthPtr, mappedCh, pitch); - if (r1 !== 0) { - r1 = _fluidModule._fluid_synth_noteon(_synthPtr, mappedCh, pitch, 0); - } - } catch (e) { console.warn("[SonicSF] stopNote error:", e); } } }, @@ -360,7 +350,6 @@ }, _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