huff's MIDI system runs natively in Rust via midir. USB controllers, USB-MIDI interfaces, and virtual ports (IAC Bus on macOS, loopMIDI on Windows) are all supported. There is no Web MIDI API involved.
Connecting a Device
- Click the MIDI button in the top bar to open the MIDI panel.
- Click ↻ Refresh to scan available ports.
- Select your device from the dropdown.
- Click Connect. The status area confirms the port name.
Hot connection: The MIDI port list is refreshed on demand. Click ↻ Refresh after connecting a device. Ports connected after the app launched will not appear until you refresh.
MIDI Map Format
Maps are plain JSON files loaded at runtime via 📂 Load Map…. They persist in localStorage and reload automatically on next launch.
{
"name": "My APC mini",
"version": 1,
"channel": -1,
"mappings": [
{ "param": "feedback", "cc": 48, "type": "range", "enabled": true },
{ "param": "corrupt", "cc": 49, "type": "range", "enabled": true },
{ "param": "depth", "cc": 50, "type": "range", "enabled": true },
{ "param": "corruptOn", "cc": 64, "type": "toggle", "enabled": true },
{ "param": "refreshBtn", "cc": 82, "type": "trigger", "enabled": true }
]
}
Field Reference
| Field | Type | Notes |
| name | string | Shown in the MIDI panel |
| version | integer | Always 1 |
| channel | integer | -1 = all channels. 0–15 = specific channel (0-indexed). |
| param | string | DOM element ID — see Parameter Reference |
| cc | integer | CC number 0–127 |
| type | string | range, toggle, or trigger |
| enabled | boolean | false disables without deleting. Default: true |
Type Behaviour
range — CC 0–127 scaled linearly to the parameter's min–max.
toggle — CC > 63 → ON. CC ≤ 63 → OFF.
trigger — Any CC > 0 fires the button's click event.
Bundled Maps
| File | Controller |
| src/midi/nanokontrol2.json | Korg nanoKONTROL2 — full fader + knob + transport |
| src/midi/nanokontrol1.json | Korg nanoKONTROL (original) |
| src/midi/generic.json | Generic template using CC 14–29 |
Virtual MIDI
macOS — IAC Driver
- Open Audio MIDI Setup (Applications → Utilities).
- Open MIDI Studio (⌘2).
- Double-click IAC Driver.
- Enable Device is online, add a port (e.g. "Bus 1").
- The IAC port appears in huff's MIDI port list after a refresh.
Windows — loopMIDI
- Download and install loopMIDI.
- Create a virtual port.
- The port appears in huff's MIDI port list after a refresh.
Tip: Duplicate CCs are fine — two entries sharing a CC update both parameters simultaneously. channel: -1 is almost always correct. Most controllers default to channel 1 but some advertise "all channels" — -1 handles both.