HeadlinesBriefing favicon HeadlinesBriefing.com

pianoterm: Linux MIDI Tool Turns Piano Keys into Shell Commands

Hacker News •
×

A developer has created pianoterm, a Linux CLI tool that transforms USB MIDI keyboard keys into shell command triggers. The project, described as a weekend experiment, lets musicians control media playback and run scripts directly from their piano keyboard. This tool enables users to pause, play, or rewind audio without touching their computer.

pianoterm uses ALSA as the soundcard driver and requires users to configure key mappings in a config file. The setup process involves using tools like aconnect and aseqdump to identify MIDI ports and keycodes. Each key can be assigned specific commands, from media controls using playerctl to custom scripts stored on the user's system.

The tool is built from C source code and depends on a C compiler and alsactl. While simple in concept, pianoterm demonstrates how MIDI devices can be repurposed beyond music creation. For musicians learning by ear or producers who need hands-free control during recording sessions, this tool eliminates the need to switch between keyboard and computer, streamlining the creative workflow.