fix: MIDI NoteOff stops note immediately (60000ms duration + stopNote)

- NoteOn: durationMs=60000 (1 phút, giữ cho đến khi NoteOff)
- NoteOff: stopNote(ch, pitch) gọi synthInstance.noteOff() ngay
- MIDI channel (msg.data[0] & 0x0F) truyền đúng vào playNote
- CC (sustain/modulation) + pitch bend forward qua SpessaSynth
This commit is contained in:
2026-07-27 11:06:35 +07:00
parent 5a49d2012b
commit e6439c2d9d
2 changed files with 22 additions and 10 deletions
@@ -161,6 +161,13 @@
}
},
stopNote: function (channel, pitch) {
if (channel < 0 || channel > 15) return;
if (_initialized && _synthInstance) {
try { _synthInstance.noteOff(channel, pitch); } catch (e) {}
}
},
playNote: function (note, velocity, durationMs, startTime, program, destinationNode, channel, synthEngine) {
if (_initialized && _synthInstance) {
this._playNoteSpessa(note, velocity, durationMs, startTime, program, channel, synthEngine);