This Python command-line tool listens to the sound of your Mac and turns the keyboard LED on/off depending on the volume level. It would look cool when playing music. This tool utilizes keyboards that use the Scroll Key to turn on RGB. If your keyboard uses another key, it will not work. However, I may try to make them work in the future.
To use this tool, you will need to install the following:
- Python3.
- A fake software audio device such as BlackHole, which is a free and open-source audio device that can be used as an input or output.
- LadioCast, an app from the App Store.
- Homebrew
- latest version in releases. Click on
rhythm.keyboard.zip
to download the tool.
Extract the zip file
open the terminal windowinside the path of the extracted folder
run brew install portaudio
run python3 -m pip install -r requirements.txt
. This will download the necessary Python libraries for the code to run.
Go to System Settings > Sound, click on Output and select BlackHole, then click on Input and make it BlackHole.
Launch the LadioCast app, click on Input 1 and select BlackHole, then select Main Output and select your output device. For example, I am connected to a Samsung SmartTV screen and my Mac sound is coming out from it.
Finally, to use the tool, run python3 rhythm_keyboard.py
. The program will run indefinitely until the user either closes the terminal window or presses ctrl+z
in the terminal window.
This tool has been tested with a gaming keyboard that uses the scroll key to turn on/off RGB/LED.
Please note that this is still a beta tool and more features and a GUI are planned for future releases.
Special thanks to damieng for helping make this project possible. Be sure to check out his work! The great developers of BlackHole, Python, Homebrew, and LadioCast to make such project possible!