■ huff Home How It Works Install Interface MIDI OSC Output
--:--:--
MIDI
_

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

  1. Click the MIDI button in the top bar to open the MIDI panel.
  2. Click ↻ Refresh to scan available ports.
  3. Select your device from the dropdown.
  4. 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

FieldTypeNotes
namestringShown in the MIDI panel
versionintegerAlways 1
channelinteger-1 = all channels. 0–15 = specific channel (0-indexed).
paramstringDOM element ID — see Parameter Reference
ccintegerCC number 0–127
typestringrange, toggle, or trigger
enabledbooleanfalse 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

FileController
src/midi/nanokontrol2.jsonKorg nanoKONTROL2 — full fader + knob + transport
src/midi/nanokontrol1.jsonKorg nanoKONTROL (original)
src/midi/generic.jsonGeneric template using CC 14–29

Virtual MIDI

macOS — IAC Driver

  1. Open Audio MIDI Setup (Applications → Utilities).
  2. Open MIDI Studio (⌘2).
  3. Double-click IAC Driver.
  4. Enable Device is online, add a port (e.g. "Bus 1").
  5. The IAC port appears in huff's MIDI port list after a refresh.

Windows — loopMIDI

  1. Download and install loopMIDI.
  2. Create a virtual port.
  3. 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.