Summary of Arduino Performance Utility Tools
The article describes several Python 3 utility and test scripts related to MIDI handling, including listing available MIDI ports, monitoring MIDI streams with a GUI, and emulating an Akai MPD218 drum pad controller. These standalone scripts utilize the python-rtmidi package for MIDI communication and are part of exercise packages that require Python 3 and specific additional packages.
Parts used in the Python MIDI tools project:
- Python 3
- python-rtmidi package
- list_MIDI_ports.py script
- midi_display.py script
- virtual_mpd218.py script
- Arduino (for virtual_mpd218.py source)
Some of the exercise packages include several utility and test programs. These are all standalone scripts using Python 3 and a few additional packages as described in Python 3 Installation.
The following scripts may be browsed in the Python MIDI tools directory on the course site.

list_MIDI_ports.py
Command-line test program for identifying available MIDI ports by printing a list of the MIDI input and output ports available via python-rtmidi. There are no options, just running it will print a list of port names:
python3 list_MIDI_ports.py
The full code follows, but may also be downloaded from list_MIDI_ports.py.
#!/usr/bin/env python3 import rtmidi midiout = rtmidi.MidiOut() midiin = rtmidi.MidiIn() print("Available output ports:") for idx, port in enumerate(midiout.get_ports()): print(" %d: %s" % (idx, port)) print("Available input ports:") for idx, port in enumerate(midiin.get_ports()): print(" %d: %s" % (idx, port))
midi_display.py

Test program for monitoring MIDI stream, providing a GUI for connecting to a MIDI source and printing all messages.
virtual_mpd218.py

Emulation of an Akai MPD218 Drum Pad Controller, generating local MIDI events and control changes.
Source: Arduino Performance Utility Tools