This post is a stub for anyone out there who needs the configs. Works for me, YMMV.
Bitfocus Companion resides within a Docker container on a Raspberry Pi. The Novation Launchpad is physically connected to the Pi via USB.
The communication is bidirectional, with the pads changing colour to reflect the remote state. (For example, muting the mic within the OBS application or the Companion web interface changes the colour of the pad in this example photograph, just as pressing the pad itself does.)
Docker container
docker run -d --name companion \
--restart unless-stopped \
-p 8000:8000 \
-p 16622:16622 \
-p 16623:16623 \
-v companion-data:/companion \
--device /dev/snd \
--group-add audio \
ghcr.io/bitfocus/companion/companion:latest
generic-midi connection in Companion with DA 28:0 set for Midi IN & OUT
/etc/systemd/system/lp-companion.service
[Unit]
Description=Launchpad Mini MK3 layout + Companion aconnect
After=docker.service sound.target
Wants=docker.service
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/local/bin/lp-companion.sh
[Install]
WantedBy=multi-user.target
/etc/systemd/system/lp-companion.timer
[Unit]
Description=Retry Launchpad Companion patch
[Timer]
OnBootSec=20s
OnUnitActiveSec=30s
AccuracySec=2s
[Install]
WantedBy=timers.target
/usr/local/bin/lp-companion.sh
#!/bin/bash
set -uo pipefail
log() { echo “[lp-companion] $*”; }
for i in $(seq 1 30); do
if aconnect -l | grep -q “LPMiniMK3 MI” && aconnect -l | grep -q “RtMidi Output Client”; then
break
fi
sleep 1
done
if ! aconnect -l | grep -q “LPMiniMK3 MI”; then
log “no Launchpad”
exit 1
fi
if ! aconnect -l | grep -q “RtMidi Output Client”; then
log “no Companion RtMidi”
exit 1
fi
DA=$(amidi -l | awk ‘/LPMiniMK3 DA/{print $2; exit}’)
MI=$(amidi -l | awk ‘/LPMiniMK3 MI/{print $2; exit}’)
log “DA=${DA:-none} MI=${MI:-none}”
# User layout (custom 3 = 0x06). Do not send Live (0E 00) here; it knocks User off.
for P in ${DA:-} ${MI:-}; do
amidi -p “$P” -S ‘F0 00 20 29 02 0D 00 06 F7’ || true
done
CLIENT=$(aconnect -l | sed -n “s/^client \([0-9][0-9]*\): ‘Launchpad Mini MK3’.*/\1/p” | head -1)
RT_IN=$(aconnect -l | awk ‘/RtMidi Input Client/{gsub(”:”, “”, $2); print $2”:0”; exit}’)
RT_OUT=$(aconnect -l | awk ‘/RtMidi Output Client/{gsub(”:”, “”, $2); print $2”:0”; exit}’)
LP=”${CLIENT}:1”
log “LP=$LP RT_IN=$RT_IN RT_OUT=$RT_OUT”
if [ -z “${CLIENT:-}” ] || [ -z “${RT_IN:-}” ] || [ -z “${RT_OUT:-}” ]; then
log “missing client”
exit 1
fi
aconnect -d “$LP” “$RT_IN” 2>/dev/null || true
aconnect -d “$RT_OUT” “$LP” 2>/dev/null || true
aconnect “$LP” “$RT_IN”
aconnect “$RT_OUT” “$LP”
log done
exit 0




