Macro keyboard for button events/actions?

I think the button is very cool, but I don’t use it much. I have Pisound/RPi4 integrated into my rig, and I use it primarily for running Csound programs and acting as a MIDI host. I run it strictly headless (except when I use Xvfb+VNC for things like the Midihub UI), and primarily use SSH (via a remote terminal or the RaspController app on Android) to do things like starting and stopping Csound programs. I have not been using the button, because I find it hard to remember all the mappings, and I find it a bit cumbersome to use multiple clicks and holds and always get my timing correct. Using SSH from my phone or tablet works very well, but I don’t love using needing to depend on either of those devices in a live situation, especially if my aging eyes need to read text in a terminal in a low-light environment.

Would it be possible to use a macro keyboard to mimic Pisound button mappings? If I could set that up, then I could dedicate specific keys for specific actions, which would be much more usable for me.

I know that macro keyboards work by generating key events. So if I could find a way to map button actions to key combinations, then I would be able to map the macros keys to those key combinations. I’m guessing that this would require modifying the pisound-btn to respond to keyboard events. Is this at all feasible? Is there perhaps a better way?

After posting this, it occurred that maybe I could use MIDI for this somehow. The mididings package looks promising. But I’d still like to know if it’s feasible to use the Pisound infrastructure in some way.

MIDI is a good option for this, there’s a project here in the community that already implements executing desired scripts based on MIDI input:

You can find the Pisound button scripts located at /usr/local/pisound/scripts - you may simply trigger the desired scripts yourself.

Thanks, that looks very good! I started to look into mididings, but it does much more then I need (especially since I already have Midihub). This solution could be ideal.

1 Like