Skip to main content

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

  1. 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
    
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Use serial_midi_bridge.py
    python 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

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

  1. MIDI or Serial Device Not Found

    • Ensure your devices are properly connected and recognized by your system
    • Use the -l option to list available devices
    • Verify the exact names of your devices
  2. MIDI Messages Not Being Sent/Received

    • Enable verbose mode with -v flag to see all MIDI messages
    • Check if your MIDI devices are properly configured
    • Verify that your MIDI routing is set up correctly
  3. Baud Rate Mismatch

    • Ensure the baud rate matches your device's configuration (default is 9600)
    • Use -v flag to see all MIDI messages; if they are are all \x00 the baud rate is most likely incorrect

If you find a bug, please create an issue and contributions are always welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

serial_midi_bridge-1.0.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

serial_midi_bridge-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

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

Hashes for serial_midi_bridge-1.0.0.tar.gz
Algorithm Hash digest
SHA256 95e8814ad98cc81e0e9efe1310c6faba290a23f9f43d9200069d6f4320d58c7d
MD5 934eabcf2ad8e82eb4fb0698421d5810
BLAKE2b-256 2faa1a9e1d9ac2f49324dbe6e662f4d7a302230a37a3be850d2ac83afa7d321a

See more details on using hashes here.

File details

Details for the file serial_midi_bridge-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for serial_midi_bridge-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fc344ead4ec018773a16ad9a8f0b447c81258678eba37ea4ed697e9cc9c0ae1
MD5 66f0ff72185a2ddb6d59f405a6088e71
BLAKE2b-256 bb83881d50022d28bc3e023254a7ab2904621abf5d82fc15aadecfd05426bf8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page