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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user