Run shell commands from your piano
Linux CLI tool to assign shell commands to keys or knobs on a USB MIDI Keyboard/Controller
pianoterm <port>Note:
- It will keep trying to connect until it finds the port, use ctrl+c to stop it
- You must have aconnect and aseqdump in your path
- You can use 'acconect -i' to find the port
- path: ~/.config/pianoterm/config
## Control audio playback
on_press
21 = playerctl previous # first key on an 88-key keyboard
22 = playerctl play-pause
23 = playerctl next
## Map directly to keyboard keys (Wayland)
on_press
107 = ydotool key 108:1
108 = ydotool key 103:1
on_release
107 = ydotool key 108:0
108 = ydotool key 103:0
## Run custom scripts
69 = /home/me/my_script.sh
## Assign multiple commands to run sequentially on the same key press
60 = notify-send "command 1"
60 = notify-send "command 2"
## Map controller events (pedal presses, knob switches, ...)
64 (127) = notify-send "Pressed pedal" # 127 in this case is the max pedal output
64 (0) = notify-send "Released pedal"
- Keys and buttons:
# Default - on_press
[on_press|on_release|on_hold]
key = command
- Controllers (pedals, knobs, etc.):
# Must include a trigger value
# A trigger is numeric value greater than 0. (usually the pressure on a pedal, the volume on a knob, etc.)
key (trigger) = command
Notes:
- A different key and controller can share the same key.
- You can use aseqdump -p to find keycodes and controller values.
git clone https://github.com/vustagc/pianoterm.git
cd pianoterm && make- C compiler
- alsactl (1.2.15.2)
- make (optional)