A bridge for serial devices and MIDI controllers
Project description
Serial MIDI Bridge
A lightweight Python-based Serial to MIDI bridge that enables devices to communicate via MIDI-over-serial
Features
- Low latency (< 5ms) bidirectional MIDI message processing
- Cross-platform compatibility (Windows, macOS, Linux)
- Support for standard MIDI messages
- Simple command-line interface
- Auto-reconnects to serial device if device drops out
- No threading, asyncio, or event loops
Installation
Setup
- Create and activate a virtual environment:
# Create virtual environment python -m venv venv # Activate virtual environment # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Use
serial_midi_bridge.pypython serial_midi_bridge.py --device {serial device name} --midi_in {midi input device name} --midi_out {midi output device name} # If you want to list available devices, use `-l` option python serial_midi_bridge.py -l
Virtual MIDI Setup
For instructions on setting up a virtual MIDI device, see Ableton's "Setting up a virtual MIDI bus" guide
Dependencies
- Python 3
- python-rtmidi
- PySerial
Quickstart
macOS
python3 serial_midi_bridge.py -d /dev/tty.usbserial -i "IAC Driver Bus 1" -o "IAC Driver Bus 2"
Windows
python.exe .\serial_midi_bridge.py -d COM4 -i "loopMIDI Port IN 0" -o "loopMIDI Port OUT 2"
Usage
$ python3 serial_midi_bridge.py -h
usage: serial_midi_bridge.py [-h] -d DEVICE [-b BAUD]
[--midi_in {IAC Driver Bus 1,IAC Driver Bus 2,GarageBand Virtual In}]
[--midi_out {IAC Driver Bus 1,IAC Driver Bus 2,GarageBand Virtual In}] [--debug]
Serial to MIDI bridge
options:
-h, --help show this help message and exit
-d DEVICE, --device DEVICE
Serial port name
-b BAUD, --baudrate BAUD
baud rate
--midi_in MIDI_IN MIDI input device name
--midi_out MIDI_OUT MIDI output device name
-l, --list List available USB devices and MIDI devices
-v, --verbose Print all MIDI messages
To run the bridge, device, baudrate, midi_in, and midi_out are required. You can use --list (or -l) option to list available devices.
Issues
-
MIDI or Serial Device Not Found
- Ensure your devices are properly connected and recognized by your system
- Use the
-loption to list available devices - Verify the exact names of your devices
-
MIDI Messages Not Being Sent/Received
- Enable verbose mode with
-vflag to see all MIDI messages - Check if your MIDI devices are properly configured
- Verify that your MIDI routing is set up correctly
- Enable verbose mode with
-
Baud Rate Mismatch
- Ensure the baud rate matches your device's configuration (default is 9600)
- Use
-vflag to see all MIDI messages; if they are are all\x00the baud rate is most likely incorrect
If you find a bug, please create an issue and contributions are always welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file serial_midi_bridge-1.0.0.tar.gz.
File metadata
- Download URL: serial_midi_bridge-1.0.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95e8814ad98cc81e0e9efe1310c6faba290a23f9f43d9200069d6f4320d58c7d
|
|
| MD5 |
934eabcf2ad8e82eb4fb0698421d5810
|
|
| BLAKE2b-256 |
2faa1a9e1d9ac2f49324dbe6e662f4d7a302230a37a3be850d2ac83afa7d321a
|
File details
Details for the file serial_midi_bridge-1.0.0-py3-none-any.whl.
File metadata
- Download URL: serial_midi_bridge-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fc344ead4ec018773a16ad9a8f0b447c81258678eba37ea4ed697e9cc9c0ae1
|
|
| MD5 |
66f0ff72185a2ddb6d59f405a6088e71
|
|
| BLAKE2b-256 |
bb83881d50022d28bc3e023254a7ab2904621abf5d82fc15aadecfd05426bf8b
|