Git Product home page Git Product logo

serial_to_midi_bridge's Introduction

This command line script establishes Serial to MIDI bridge. It will be useful with micro controller boards such as Arduino, ESP32, they only have UART-USB interface.

I made this since useful Hairless MIDI Serial bridge program stopped working with OS X Catalina.

It processes most of MIDI messages. It has only very low latency (probably less than 5ms) so far.

Requirements / Installation

This script needs python-rtmidi, PySerial and Python 3.

  1. Install Python 3
  2. Install pip
  3. pip install python-rtmidi
  4. pip install pyserial
  5. Download serialmidi.py

Quickstart

MAC OS X example
$ python3 serialmidi.py --serial_name=/dev/cu.SLAB_USBtoUART --midi_in_name="IAC Bus 1" --midi_out_name="IAC Bus 2"

WINDOWS example
$ python.exe .\serialmidi.py --serial_name=COM4 --midi_in_name="loopMIDI Port IN 0" --midi_out_name="loopMIDI Port OUT 2"

setup

  1. Run serialmidi.py -h to see this help.
$ python3 serialmidi.py -h
usage: serialmidi.py [-h] --serial_name SERIAL_NAME [--baud BAUD]
                     [--midi_in_name MIDI_IN_NAME]
                     [--midi_out_name MIDI_OUT_NAME] [--debug]

Serial MIDI bridge

optional arguments:
  -h, --help            show this help message and exit
  --serial_name SERIAL_NAME
                        Serial port name. Required
  --baud BAUD           baud rate. Default is 115200
  --midi_in_name MIDI_IN_NAME
  --midi_out_name MIDI_OUT_NAME
  --debug               Print incoming / outgoing MIDI signals
  1. Figure out serial port name and baud rate. Baud rate default is 115200.
  2. Run serialmidi.py --serial_name=[serial_port] --baud=[baud]. Make sure it doesn't say "Serial port opening error.".
  3. The script prints recognized MIDI devices. Use one of listed name as argument of --midi_in_name and --midi_out_name. Here is an example on OS X.
INFO:root:IN : 'IAC Bus 1','IAC Bus 2'
INFO:root:OUT : 'IAC Bus 1','IAC Bus 2'

You may want to use MIDI loop bus such as IAC Bus for OS X, or loopMIDI for Windows. Also, you need to use different bus in order to avoid signal loop.

  1. If it is not working, try --debug option. It will dump all incoming / outgoing MIDI messages. Or create an issue on the GitHub page.

Tested environment

  • Tested with OS X Catalina with ESP32 board, and Windows10 with loopMIDI.

Other notes

  • It's made for my ESP32 based synthesizer, so I tested MIDI IN a lot, but MIDI OUT. MIDI OUT message processing might have some bugs. Please let me know if you find it.

serial_to_midi_bridge's People

Contributors

raspy135 avatar esophagoose avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.