Show HN: Macros with a Behringer FCB1010 MIDI Pedalboard in macOS
fcbnerd is a tool that turns a Behringer FCB1010 MIDI pedalboard into an extra keyboard for macOS. It connects to MIDI sources and executes shell commands or prints JSON objects based on footswitch or pedal messages. The tool works with any CoreMIDI source, not just the FCB1010. fcbnerd only reads MIDI data, requiring no permissions.
Actions, such as pressing keys or running scripts, require permissions that sandboxed apps can't obtain. fcbnerd uses /bin/sh -c or a specified shell to run commands, with stdin set to /dev/null and stdout redirected to stderr. Environment variables include details about each stomp, allowing for multiple actions per event. Commands run in the background, with fcbnerd keeping track of the latest value for each control to avoid running the same command multiple times during a sweep.
If a command takes too long to finish, fcbnerd reports an error. fcbnerd listens for MIDI messages via the command line and outputs JSON objects containing type, source, and timestamp for each event. It supports binding patterns with * to match any value, and functions from interactive shells can be used by exporting them in zsh or sourcing them in bash.
The FCB1010 sends no messages when a switch is released, so bindings only trigger on press. To use fcbnerd with an expression pedal, the pedal's value is bound to a command that runs in the background.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.