midiHost turns a Raspberry Pi 2 with a small PiTFT screen and four buttons into a standalone USB MIDI host. My Akai MPK mini Play can then play other instruments without a computer in between.
Incoming MIDI events go into a queue on a dispatcher thread and through a chain of filters (transpose, channel mapping, controller mapping, pressure to CC) before they are sent on:
- for a Novation Circuit, notes go to channel 1 or 2, one per synth;
- for a Korg Kaossilator Pro+, a custom filter turns notes into positions on its XY pad: X comes from the note and Y from a knob on the keyboard.
The interface is text-mode (curses) on the little screen, and the four hardware buttons switch modes. It is based on the filter example from python-rtmidi.