#midi #cli-tool #devices #command #trigger #compatible

app midiboard

CLI tool to trigger arbitrary commands using any MIDI 1.0 compatible device

4 releases

0.3.3 Nov 5, 2022
0.3.2 Nov 3, 2022
0.3.1 Oct 26, 2022
0.3.0 Oct 26, 2022

#1941 in Command line utilities

MIT license

53KB
1K SLoC

MidiBoard

CLI tool to trigger arbitrary commands using any MIDI 1.0 compatible device.

1. What is this?

This tool lets the user associate any executable commands to actions in one or more MIDI devices, like changing volume, altering backlight level, changing a song, starting/stopping a service, or launching any script/executable, on the press of a button or turn of a knob.

2. Getting Started

To use this software you need to install it, define a configuration, and then either run at-will or daemonize the process. The most cumbersome part, of course is writing the configuration file.

For details check the docs.

3. Install

3.1. Cargo

cargo install midiboard

3.2. Manual

  1. Clone

    git clone https://github.com/aordano/midiboard.git
    
  2. Build

    cd midiboard
    cargo build --release
    
  3. Copy binary

    sudo cp ./target/release/midiboard /usr/bin/midiboard
    

4. Configuration

For details on the configuration file check the config docs page.

For help using the CLI, there is integrated help via the --help flag.

4.1. Create a skeleton

This will create it at $HOME/midiboard.json. Optionally add a --path flag to change the output location:

midiboard config --generate

4.2. Define your device

Get the name of your device and put it in the device field in the config:

midiboard devices --list

4.3. Define each command

Listen to the input to know what Is the numerical key value of your chosen knob/button/key:

midiboard devices --input [DEVICE_NAME]

With that value you can fill the corresponding entry on the config file.

5. Running

5.1. Manually

By default it will expect a config file at $HOME/midiboard.json.Optionally add a --path flag to change the output location:

midiboard run

5.2. Daemonized

  1. Get the service file

    wget -O midiboard.service https://raw.githubusercontent.com/aordano/midiboard/master/schema/midiboard.service
    
  2. Patch and move the service file

    sed -i "s/@USER@/$(whoami)/g" midiboard.service
    sudo mv midiboard.service /etc/systemd/system/midiboard.service
    

    The file uses the default config location. Modify the service file if you have an alternate path for the config file (add the --path flag).

  3. Enable the service

    sudo systemctl daemon-reload
    sudo systemctl enable --now midiboard
    

Dependencies

~6–38MB
~515K SLoC