From a27f1e8cf9733108f7fc1a893c83c9edfcf94a69 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 20 Apr 2022 19:32:19 +0200 Subject: [PATCH] Vkbd: fix stuck notes when playing fast The virtual keyboard sends all events with the same timestamp. When playing fast (mouse-sweep) note-on and note-off will have the same timestamp. Since dbd8089fb8, a393f75694 concurrent MIDI are sorted with note-off first. This correctly handles events when played from the timeline: note-on .. note-off|note-on ... note-off But in case of a MIDI keyboard a note-off event must be send after the note-on. --- gtk2_ardour/virtual_keyboard_window.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/virtual_keyboard_window.cc b/gtk2_ardour/virtual_keyboard_window.cc index b7c4f61493..8f80c80249 100644 --- a/gtk2_ardour/virtual_keyboard_window.cc +++ b/gtk2_ardour/virtual_keyboard_window.cc @@ -561,7 +561,7 @@ VirtualKeyboardWindow::note_off_event_handler (int note) ev[0] = MIDI_CMD_NOTE_OFF | channel; ev[1] = note; ev[2] = 0; - _session->vkbd_output_port ()->write (ev, 3, 0); + _session->vkbd_output_port ()->write (ev, 3, 1); } void