Deej - Physical Volume Sliders Per-application
About the project
Arduino project for controlling per-application audio volume with physical sliders
Project info
Items used in this project
Hardware components
Software apps and online services
Story
deej is an Arduino project for controlling audio volume for separate Windows apps with physical sliders (like a DJ!) Full source code and documentation are available on GitHub.
Ever since I was a child, I loved all kinds of buttons and knobs. Elevators were my favorite place to be. When I was 3, I had a Boston hotel evacuated because its fire alarm looked all kinds of shiny to me. My obsession with physical controls that are tactile and give you instant feedback hasn't gone anywhere in the years since, and a few months ago I decided to finally do something about it and build myself a box that I've been wanting for a while.
As a PC gamer I often find myself balancing audio levels between several sources at once - the game I'm playing vs. music from Spotify or a video from YouTube, voice chat from Discord vs. game audio and background music, etc.
Balancing these manually can be a pain, especially mid-game - you have to pause (which you sometimes can't) to open an options menu, or even tab out to find the other program's volume slider, or you have to use Windows' Mixer.
Enter deej:
How it works
Hardware
- The sliders are connected to 5 analog pins on an Arduino Uno board. They're powered from the board's 5V output (see schematic)
- The board connects via a USB cable to the PC
Software
- The code running on the Arduino board is a C program constantly writing current slider values over its Serial interface
deej-arduino.ino
- The PC runs a Python script
deej.py
that listens to the board's Serial connection, detects changes in slider values and sets volume of equivalent audio sessions accordingly.
- A VBScript-based run helper
run.vbs
allows this Python script to run in the background (from the Windows tray).
Slider mapping
A configuration is passed to the Deej
object as follows:
deej = Deej({
'slider_mapping': {
0: 'master',
1: 'chrome.exe',
2: 'spotify.exe',
3: [
'pathofexile_x64.exe',
'rocketleague.exe',
],
4: 'discord.exe',
},
'process_refresh_frequency': 5,
})
- Process names aren't case-sensitive
- You can use a list of process names to either:
- define a group that is controlled simultaneously
- choose whichever process in the group is currently running (in this example, one slider is for different games that may be running)
master
is a special option for controlling master volume of the system.
- The
process_refresh_frequency
option limits how oftendeej
may look for new processes if their appropriate slider moves. This allows you to leavedeej
running in background and open/close processes normally - the sliders will #justwork
How to run
To make sure you're using the correct up-to-date instructions, please check out the GitHub repository. Running deej is simple, and it runs silently in the background - all that's left for you is to push some sliders around!
Leave your feedback...