midictrl-companion/midictrl.sh
2024-04-01 00:05:23 +02:00

20 lines
490 B
Bash
Executable File

#!/bin/bash
# Read the MIDI inputs of a MIDI device and redirect them to Bitfocus Companion.
#
# 2024 Adrian Baumgart, MIT License
# https://git.abmgrt.dev/rainloreley/midictrl-companion
#
# Code based on https://linux.reuf.nl/projects/midi.htm
MIDI_CLIENT="Arduino Micro"
BANK=1
aseqdump -p "$MIDI_CLIENT" |
{
read
read
while IFS=" ," read src ev1 ev2 ch label1 ctrl_no label2 ctrl_value rest
do
curl -s "http://127.0.0.1:8000/press/bank/$BANK/$ctrl_no" > /dev/null
done
}