
PrismRhythm: AI-Directed Razer Chroma RGB Lighting That Follows a Song's Emotion
Most RGB music visualizers only react to loudness. Whether you're listening to a quiet, melancholic verse or an explosive stadium chorus, a standard spectrum analyzer just flashes bars up and down with the volume.
PrismRhythm takes a different approach. It is an open-source, AI-directed Windows Chroma app for Razer devices that combines synchronized lyrics, Gemini semantic analysis, Windows playback metadata, and live WASAPI audio features to direct lighting scenes that evolve with a song's actual emotional narrative.
GitHub Repository: Dawn-Of-Justice/PrismRhythm (MIT License · v0.6.0 · Windows 10/11)
See It in Action
Instead of bouncing blindly with decibels, PrismRhythm shifts into cool, restrained palettes during a sad verse, blooms into brighter motion as the tension lifts, and brings back a recognizable visual motif whenever a chorus returns. Lyrics drive the emotional direction; live bass, mids, highs, energy, and beats drive the physical movement.

Watch the full demo with sound: PrismRhythm Demo Video (MP4 on GitHub)
How It Works Under the Hood
A core design rule behind PrismRhythm is never putting an AI call inside the animation loop. Interpretation, timing, rendering, and hardware output are strictly separated so the RGB frames stay smooth and responsive regardless of model latency:

1. Zero-OAuth Track Detection
You don't need a Spotify developer account or OAuth tokens. WindowsMediaMonitor reads Windows' built-in Global System Media Transport Controls (GSMTC) via winrt — with a player-title fallback if the media-session service is unavailable — so it works seamlessly with Spotify, browsers, and other Windows media players.
2. Fast, Sparse Semantic Analysis
When the track changes, PrismRhythm fetches timestamped lyrics from LRCLIB using conservative title/artist/album/duration checks (to avoid mismatching remixes or alternate cuts, with manual .lrc import as a fallback). It then asks Gemini 3.5 Flash-Lite for only the song's key narrative turning points using a closed palette and motion vocabulary. Expanding those sparse cues locally keeps first-play latency low.
3. Motif Memory & Smooth Scene Transitions
SemanticSceneDirector turns discrete lyric cues into continuous lighting using cut, morph, bloom, and fade transitions. Repeated lyric lines receive stable motif IDs, meaning returning choruses reuse a recognizable color palette and movement pattern while still reacting to the song's live intensity.
4. Local WASAPI Loopback & Lag-Free Hardware Output
WasapiAudioMonitor (using PyAudioWPatch and NumPy) reads short in-memory audio blocks from your default output device to extract real-time energy, bass, mids, highs, and beats — without recording or uploading audio. On the hardware side, ChromaFramePump maintains a newest-frame-only queue so slow USB/REST I/O can never build up lag behind the beat.
Key Highlights
- Full Razer Chroma coverage: Outputs to keyboard, mouse, headset, mousepad, keypad, and Chroma Link devices.
- No hardware required to test: Built-in localhost browser dashboard includes a real-time preview even when Razer Synapse or Chroma gear isn't connected.
- Comfort mode by default: Caps rapid brightness spikes to avoid harsh strobing, alongside global brightness and 0–2× audio sensitivity controls.
- Privacy-first design: Audio never leaves your machine, your Gemini API key stays in an ignored local
.env(or Windows Credential Manager in packaged builds), and completed track analyses live only in a bounded 24-track in-memory cache that clears when the app closes.
Requirements
- OS: Windows 10 (x64) or Windows 11
- Razer Software: Razer Synapse with Chroma / Chroma Connect enabled (optional if using browser preview)
- Python: 3.11 or newer (when running from source)
- API Key: Your own Gemini API key for automatic semantic lyric analysis
Getting Started
Option A: Install a Packaged Windows Build
Download the latest release from GitHub Releases, verify the SHA-256 checksum, extract it, and launch PrismRhythm.exe. (Note: Current beta builds are unsigned, so Windows SmartScreen may prompt you before running.)
Option B: Run From Source
Clone the repository and run the included setup and launch scripts:
git clone https://github.com/Dawn-Of-Justice/PrismRhythm.git
cd PrismRhythm
.\setup.bat
.\run.batOr launch directly from PowerShell after setup:
.\.venv\Scripts\python.exe app.pyPrismRhythm opens its dashboard on a random localhost port. From there, paste your Gemini API key under Semantic Lyrics, click Connect Razer Chroma, play a track, and watch your desk react to the mood of the song.
Running Tests
If you're hacking on the renderer, scene director, or audio pipeline, you can run the test suite and frontend syntax check with:
.\.venv\Scripts\python.exe -m unittest discover -s tests -v
node --check web\app.jsProject Status & Roadmap
PrismRhythm is an active working prototype (v0.6.0). The next milestones toward a wider public release include Authenticode code signing for Windows installers, broader peripheral/layout testing, and submitting to the Razer Chroma Workshop.
Links & Resources
- Source Code: PrismRhythm on GitHub
- Downloads: GitHub Releases
- Documentation: Architecture · Privacy & Data Flow · Razer Workshop Checklist
Disclaimer: PrismRhythm is an independent open-source project and is not affiliated with or endorsed by Razer, Spotify, LRCLIB, or Google.




Comments