Only print MIDI device list if any are found in MIDI Piano (#1039)

This is a silly "fix", but it prevents an empty `[]` from being printed every time
this demo is run without a MIDI device plugged into the computer.

The MIDI devices list is printed if one is plugged into the computer, which I have tested.
This commit is contained in:
Christen Lofland 2024-04-09 18:30:09 -05:00 committed by GitHub
parent 79d30931c3
commit d190e73ad3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ func _ready():
if white_keys.get_child_count() != black_keys.get_child_count():
_add_placeholder_key(black_keys)
OS.open_midi_inputs()
print(OS.get_connected_midi_inputs())
if len(OS.get_connected_midi_inputs()) > 0:
print(OS.get_connected_midi_inputs())
func _input(input_event):