kyleneideck / BackgroundMusic

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
GNU General Public License v2.0
16.12k stars 675 forks source link

Connect to an arduino to build a hardware mixer #503

Open CallMeTuesday opened 3 years ago

CallMeTuesday commented 3 years ago

Is it possible to use this in combination with an Arduino to build a hardware mixer? Something like this:

https://www.thingiverse.com/thing:4627779

I'm imagining it's something like connect the arduino to midi devices then have them picked up by BGMusic?

I'm looking for something similar to Deej, hoping this is might work. Thanks for your hard work!

kyleneideck commented 3 years ago

@marcuswu recently added some properties to the AppleScript interface that you should be able to use for that.

Have a look at https://github.com/kyleneideck/BackgroundMusic/pull/457 and https://github.com/omriharel/deej/issues/7.

marcuswu commented 3 years ago

The owner of the deej project stated he wouldn't merge my branch because it has external dependencies. You can find my branch with mac support at https://github.com/marcuswu/deej/tree/macSupport

marcuswu commented 3 years ago

Oh, one note about that branch -- I also added "event" support. It's basically just binary event passing as opposed to the analog data deej normally works on for volume control. This is helpful for other controls such as buttons. The config.yaml in that branch has an example event_mapping field which maps events to commands. Events are passed through the serial connection the same way as the volumes for deej are. All events are appended to the volume data following the same pattern of separating fields by the '|' character.

In my case I connected a button to both a USB switch and to the arduino. The button triggers the USB switch directly, but the arduino can also sense it which sends the event along to deej. When deej sees that button has been pressed, it executes a command to switch my monitor input source (via DDC). This in effect gives me a cheap KVM switch. I also built a simple audio mixer for my headphones with two input sources (two computers) into it.

BeansIsFat commented 3 years ago

@marcuswu, does your Mac version of deej communicate with MIDI control surfaces or is it Arduino-only? I already have a Behringer X-Touch Mini that I would prefer to use rather than build new hardware.