Description
Godot version
4.0.2.stable.official [7a0977c]
System information
Apple M1 macOS Ventura 13.3.1
Issue description
There are many common situations where multiple simultaneous MIDI events may occur:
- Playing a chord (multiple simultaneous
Note On
messages). - Releasing a chord (multiple simultaneous
Note Off
messages). - Some MIDI device may always precede a
Note On
orNote Off
message with aControl Change
message for High Resolution Velocity Prefix, so that pressing a single note would send 2 simultaneous messages. Active Sensing
andClock
MIDI messages emitted by MIDI device constantly in the background, happening simultaneously with other MIDI messages triggered by the user.
Godot's InputEvent System may fail to capture some of these multiple simultaneous MIDI input events. In the following report, I have demonstrated examples for situations (1) and (3) and observed Godot failed to process some expected MIDI messages. I have not experimentally confirmed situation (4), but in theory it could happen due similar timing-based mechanism if the user is unlucky.
Steps to reproduce
The following 2 examples uses MIDI Monitor on macOS (a tool to observe received MIDI messages before a program handles them) and the following GDScript to print MIDI events handled by Godot:
extends Node2D
func _ready():
OS.open_midi_inputs()
func _input(event):
if (
event is InputEventMIDI and
event.message not in [MIDI_MESSAGE_ACTIVE_SENSING, MIDI_MESSAGE_TIMING_CLOCK]
):
print(event)
Example 1: Godot failed to process 1 of 3 expected Note On
messages when playing a C-major triad chord.

What Midi Monitor observed:
- Note On
- Note On
- Note On
- Note Off
- Note Off
- Note Off
What Godot processed:
- Note On
- Note On
- Note On velocity=0
- Note On velocity=0
- Note On velocity=0
(Godot converts Note Off
messages to Note On
with velocity=0, which is odd but still conforms with MIDI Spec.)
Example 2: Godot failed to process single Note On
and Note Off
messages which were preceded simultaneously with Control Change
for High Resolution Velocity Prefix messages.

What MIDI Monitor observed:
- Control Change for High Resolution Velocity Prefix
- Note On
- Control Change for High Resolution Velocity Prefix
- Note Off
What Godot processed:
- Control Change for High Resolution Velocity Prefix
- Control Change for High Resolution Velocity Prefix