mirror of
https://github.com/godotengine/godot.git
synced 2024-12-15 15:42:46 +00:00
Merge pull request #27214 from marcelofg55/midi_note_off
Fix MIDI Note Off missing on some devices
This commit is contained in:
commit
76cbe7a9ae
@ -75,6 +75,11 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
|
|||||||
if (length >= 3) {
|
if (length >= 3) {
|
||||||
event->set_pitch(data[1]);
|
event->set_pitch(data[1]);
|
||||||
event->set_velocity(data[2]);
|
event->set_velocity(data[2]);
|
||||||
|
|
||||||
|
if (event->get_message() == MIDI_MESSAGE_NOTE_ON && event->get_velocity() == 0) {
|
||||||
|
// https://www.midi.org/forum/228-writing-midi-software-send-note-off,-or-zero-velocity-note-on
|
||||||
|
event->set_message(MIDI_MESSAGE_NOTE_OFF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user