cleanup: bỏ dead code stopNote + debug log _playNoteFluid

This commit is contained in:
2026-07-27 16:00:33 +07:00
parent 16e33b2e6a
commit 8965643450
-11
View File
@@ -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