MIDI Matrix Router hardware

MIDI Matrix Router

An 8×8 hardware MIDI router with a song-based patch system
and a dual-view web editor

What it is

MIDI Matrix Router is an embedded device built around a Teensy 4.1 microcontroller. It sits between MIDI instruments and sound modules, routing, filtering, transposing and splitting MIDI messages in real time across 8 independent input ports and 8 output ports.

Every routing configuration is called a song, and each song can contain up to 16 independent subsongs — discrete routing states that can be recalled instantly during a live performance. Songs are stored on an SD card and selected via two rotary encoders and a small OLED display directly on the device.

8 × 8 Routing

Any MIDI input can be routed to any combination of outputs, with independent channel mapping, note filtering, velocity filtering, transposition and fuzziness per connection.

Song / Subsong

A song holds up to 16 subsongs. Each subsong is a complete, independent routing state. Switching subsongs is instantaneous and non-destructive — ideal for live performance.

Per-connection operators

Each routing action can include: note-range filter, velocity-range filter, transposition (semitones), fuzziness (randomised pitch), and MIDI channel remapping (OMNI, ROUTED, or THROUGH).

💾

SD Card storage

Songs are stored as compact binary files on a standard SD card. The device boots and loads the last active song automatically, with no host computer required.

Hardware

The device is built around the Teensy 4.1, a compact ARM Cortex-M7 board running at 600 MHz with native USB MIDI and hardware serial ports — enough to handle 8 simultaneous MIDI streams with negligible latency.

  • MCU: Teensy 4.1 (600 MHz Cortex-M7)
  • Display: 1.3" OLED 128×64 SPI (SH1106)
  • Controls: 2× rotary encoders with push button
  • MIDI I/O: 8 IN + 8 OUT (opto-isolated DIN-5)
  • Storage: SD card (on-board Teensy slot)

The firmware is written in C++ (Arduino/Teensyduino). The MIDI processing loop runs with hard real-time priority; UI rendering and SD operations happen on a cooperative scheduling layer.

Teensy 4.1 board
Teensy 4.1 with OLED display
MIDI DIN connectors
8-port MIDI I/O panel
MIDI IN 1–8 Teensy 4.1 MIDI Router filter · split transpose · remap SD Card songs UI OLED · encoders MIDI OUT 1–8

Dual Representation

The routing state of a subsong can be represented in two equivalent ways: as a matrix and as a directed operator graph. Both views are fully editable and always in sync.

The Matrix

Matrix view screenshot

The matrix is an 8 × 8 grid where rows are MIDI inputs and columns are MIDI outputs. Each cell represents a potential connection. Clicking a cell opens a per-connection editor where you can set the note range, velocity range, transposition, fuzziness and channel mapping.

The matrix view is the most direct representation of the hardware routing table stored on the device: it maps one-to-one onto the binary file on the SD card.

The Operator Graph

Graph view screenshot

The graph view represents the same routing as a signal-flow diagram. MIDI data flows left to right through a chain of operator nodes — filters, splitters, transposers — before reaching an output port.

The graph makes the structure of a patch immediately visible: shared processing, splits by note range or velocity, and per-output channel remapping are all explicit nodes that can be connected graphically.

Equivalence and its limits

Any matrix configuration can be automatically abstracted into a compact operator graph — the web editor does this with one click, choosing between a flat representation (one filter chain per cell) and an optimised one that factors out shared operators into split-note and split-velocity nodes.

Conversely, any operator graph can be solved back into the matrix: the graph compiler traverses all paths from each MIDI input to each output, collects the operator parameters along the way, and writes the corresponding matrix cells.

The two representations are equivalent within a well-defined boundary: the graph can only express operations that the hardware supports (note range, velocity range, transposition, fuzziness, channel remap). Operations that cannot be expressed as a finite combination of these primitives — such as conditional routing based on message timing — lie outside the model.

filter-note
filter-velocity
split-note
split-velocity
transpose
fuzziness
set-channel
ch-map

Web Editor

The web editor runs entirely in the browser. It communicates with a small Node.js server that reads and writes the binary song files used by the device.

Matrix editor

Click any cell to open the per-connection parameter editor. Toggle connections, set note/velocity ranges with sliders, adjust transposition and fuzziness.

Graph editor

Add, connect and configure operator nodes visually. The graph compiler validates the patch and writes it back to the matrix in real time.

Abstraction

Convert any matrix patch to its most compact graph representation automatically. Two modes: flat (one chain per routing action) and optimised (split nodes factored out).

Binary export

Save the current song as a .bin file ready to be copied to the SD card and loaded by the device.

Browser note: The matrix and graph editors work in any modern browser. Connecting directly to a local Teensy via USB requires Chrome or Edge (Web Serial API). On Firefox or Safari you can still use the editor — just transfer files manually via SD card or by downloading/uploading .bin files.