tool for controlling pulseaudio, mpd and obs using a physical midi controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Henry Jameson be52d859f4 =package lock 12 months ago
.gitignore initial working version 3 years ago
README.md readme 3 years ago
index.js =update for modern stuff 12 months ago
midiController.js =update for modern stuff 12 months ago
midi_messages.js initial working version 3 years ago
package-lock.json =package lock 12 months ago
package.json =update for modern stuff 12 months ago
pulseaudioBus.js initial working version 3 years ago
yarn.lock =update for modern stuff 12 months ago

README.md

Midi Control PA (name temporary)

This is a small tool I wrote for controlling various stuff with my AKAI LPD8 midi controller.

Currently it's only configured by customizing code in index.js

Main features

Convenience options

Control PulseAudio devices with knobs

You can directly map a knob/fader (in midi terms - a "control") to a pulseaudio sink/source's volume (currently only sinks are supported). This is extra helpful when you have multiple null-sinks or remapped sinks (i.e. music/game/voip), allowing you to quickly change volume with a physical control without alt-tabbing or going into (game's) settings.

Move active window's audio to a different device

This ties back to aforementioned setup where you have multiple "virtual" devices for game/music/voip. This feature is primarily made for single usecase of moving game's audio to "game" stream but also works with almost anything.

Currently it uses xdotool to get currently active window's PID, and searches pulseaudio for any stream with that PID, using pads on controller you can move it to a different device (i have set them up to mirror the layout of knobs).

It has limitations however, if app outputs audio via a child process (i.e. Chrome) it won't see it. Also if app "locks" the output device (i.e. GZDoom) you won't be able to move it either. It however DOES support situations where app has multiple streams at once (i.e. Splitgate).

It also highlights the control of which device game is using.

Streamer's tools

Control OBS

Using pads you can switch scenes in OBS.

Control MPD with a knob

One knob is reserved for controlling MPD directly + it has autopause/autoplay and also some OBS integration, I mainly use it for turning on/off the background music and relevant display of it.

Robustness

This app can survive several types of problems, to a certain extent, and I'm currently working out the kinks with remaining problems.

  • It can (somewhat) survive PulseAudio restarts (not always?)
  • It can (somewhat) survive device disconnect (limited by the library used, check for devices every second)
  • If OBS is closed/restarted, tool also needs a restart
  • If MPD is closed/restarted, tool most likely also needs a restart

Usage / Install

dunno why you'd want to use it as-is, but install and use is simple as yarn && node index.js it will most likely won't work unless you have LPD8, but it should be easy to adapt it for your device/needs