From d190e73ad3af67447bb43ebe1ae0bcd01152e149 Mon Sep 17 00:00:00 2001 From: Christen Lofland Date: Tue, 9 Apr 2024 18:30:09 -0500 Subject: [PATCH] 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. --- audio/midi_piano/piano.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/midi_piano/piano.gd b/audio/midi_piano/piano.gd index 6cbbc963..c8bce698 100644 --- a/audio/midi_piano/piano.gd +++ b/audio/midi_piano/piano.gd @@ -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):