// HACKER NEWS — CYBERSECURITY
Show HN: Macros with a Behringer FCB1010 MIDI Pedalboard in macOS
Use a MIDI foot controller as an extra keyboard for your Mac. fcbnerd
connects to your MIDI sources and either runs a shell command when a
footswitch or pedal sends a message you've bound, or prints one JSON object
per line for every message so another program can decide what a stomp
means.
Or stream everything for another program to handle:
Built for the Behringer FCB1010, but nothing in it is FCB1010-specific: any
CoreMIDI source works.
Anything that acts on your Mac, like pressing keys or running scripts, needs
permissions that sandboxed apps can't get, and every user wants a different
set of actions anyway. fcbnerd only reads MIDI, which needs no permissions.
The actions belong to your shell, or to a tool that already has the access,
such as Hammerspoon or Keyboard Maestro.
Or from source without Homebrew (Xcode or the Swift toolchain, macOS 13+):
Status messages go to stderr; stdout carries only events. Each line is
flushed as soon as it's written, so pipes see events immediately.
First find out what your pedal sends. Run fcbnerd -f text and press the
switch:
A binding is PATTERN=COMMAND. Everything after the first = is the command,
so it can contain = and : itself. Use --bind as many times as you like.
Every binding that matches a message starts, in the order given, and they run
at the same time.
Any number can be *: 1:30:* is every value of controller 30 on channel 1,
which is how you bind an expression pedal.
Commands run in the background through /bin/sh -c, or the shell you give
with --shell. Their stdin is /dev/null. Their stdout goes to fcbnerd's
stderr, so it can't corrupt the event stream; with --quiet it goes to
stdout. They see these environment variables: