MIDIcontroller 3.3.0

August 21, 2026 · View on GitHub

A cross-platform library for building USB, Serial DIN, and Multi-Interface MIDI controllers.

by Josh Nishikawa https://github.com/joshnishikawa/MIDIcontroller

Features

  • Cross-Platform Compatibility: Native performance on Teensy (all models) with automatic compatibility across ESP32, ESP32-S3, RP2040, Arduino AVR (Uno/Mega/Leonardo/Micro), SAMD, and STM32.
  • Multi-Interface Routing & Virtual Cables:
    • MIDI_INTERFACE_USB (0): Native USB-MIDI with virtual cable support (Cables 0–15 for usbMIDIx4 / usbMIDIx16).
    • MIDI_INTERFACE_SERIAL (1): Hardware 5-pin DIN / 3.5mm Serial MIDI.
    • MIDI_INTERFACE_HOST (2): USB Host MIDI.
    • MIDI_INTERFACE_DEBUG (3): Formatted Serial Monitor debug output.
  • Flexible Controls:
    • MIDIswitch / MIDIbutton: Momentary, latch, trigger, or Note On/Off buttons (works with physical buttons and capacitive touch).
    • MIDIpot: Stable analog-to-MIDI potentiometer/fader conversion with noise filtering and optional kill-switch.
    • MIDIenc & MIDIencMulti: Continuous CC encoders and multi-mode relative jogwheels (1-CC and 2-CC modes) with sub-detent filtering and shift states.
    • MIDIdrum: Velocity-sensitive FSR or Piezo drum trigger inputs with peak detection.
    • MIDItouch: Capacitive touch ribbon/slider expression control.
  • Per-Control Configuration:
    • Assign individual channels, virtual cables, and output interfaces per control via .setChannel(chan, cable, iface).
    • Customize button message types via .setOnMessage(type, data1, data2) and .setOffMessage(...).

Requirements & Dependencies


Reference Charts

Standard MIDI Continuous Controller (CC) Map

CC NumberDescription / Typical Assignment
0Bank Select (MSB)
1Modulation Wheel
2Breath Controller
4Foot Controller
5Portamento Time
7Channel Volume (Main Volume)
8Balance
10Pan Position
11Expression Controller
16–19General Purpose Sliders 1–4
64Sustain / Damper Pedal (On/Off)
65Portamento (On/Off)
66Sostenuto (On/Off)
67Soft Pedal (On/Off)
68Legato Footswitch
70Sound Variation
71Resonance / Timbre
72Release Time
73Attack Time
74Brightness / Filter Cutoff
80–83General Purpose Buttons 1–4 (On/Off)
91Reverb Send Level
92Tremolo Level
93Chorus Send Level
120All Sound Off
121Reset All Controllers
123All Notes Off

General MIDI Percussion / Drum Map (Channel 10)

Note #KeyInstrument NameNote #KeyInstrument Name
35B0Acoustic Bass Drum51D#2Ride Cymbal 1
36C1Bass Drum 152E2Chinese Cymbal
37C#1Side Stick53F2Ride Bell
38D1Acoustic Snare54F#2Tambourine
39D#1Hand Clap55G2Splash Cymbal
40E1Electric Snare56G#2Cowbell
41F1Low Floor Tom57A2Crash Cymbal 2
42F#1Closed Hi-Hat58A#2Vibraslap
43G1High Floor Tom59B2Ride Cymbal 2
44G#1Pedal Hi-Hat60C3Hi Bongo
45A1Low Tom61C#3Low Bongo
46A#1Open Hi-Hat62D3Mute Hi Conga
47B1Low-Mid Tom63D#3Open Hi Conga
48C2Hi-Mid Tom64E3Low Conga
49C#2Crash Cymbal 165F3High Timbale
50D2High Tom66F#3Low Timbale

Acknowledgements & Community Credits

Special thanks to the contributors whose forks and ideas helped shape this release:

  • JukkaPVK: Created the MIDIencMulti multipurpose encoder class, detent accumulator bugfix, and shifted CC concepts.
  • PatternAgents (Tom Moxon): Designed the multi-interface routing architecture (USB/Serial/Host/Debug), virtual USB cable support, and per-instance channel/message configuration.
  • Drc3p0: Early multi-interface explorations and the General MIDI drum note and Standard CC reference tables.

Version Log

3.3.0

  • Cross-Platform Support: Added universal architecture support for Teensy, ESP32, ESP32-S3, RP2040, Arduino AVR, SAMD, and STM32.
  • Multi-Interface Routing: Added MIDItransport routing engine supporting USB, Serial DIN (Serial1), USB Host, and Serial Monitor Debug (MIDI_INTERFACE_DEBUG).
  • MIDIencMulti Component: Added multi-mode encoder supporting absolute CC, 1-CC relative jogwheel, 2-CC relative jogwheel, and shift states.
  • Encoder Detent Bugfix: Resolved accumulator clearing bug so PER_DETENT = 4 stepping functions smoothly.
  • Per-Control Configuration: Added .setChannel(chan, cable, iface) across all controls, plus .setOnMessage() and .setOffMessage() for buttons.
  • Reference Documentation: Added Standard MIDI CC and General MIDI Drum Map reference tables.

License

MIT License. Copyright (c) Josh Nishikawa.