I was listening to a UKF mix and got annoyed at my visualizer. Bars bouncing up and down, totally disconnected from what I was actually hearing. So I spent a weekend building something that felt more alive.

The setup is simple: a virtual audio cable feeds the system output into a PyAudio stream. From there, NumPy does FFT analysis on 2048-sample windows and I split the result into frequency bands — bass, mids, highs — each mapped to a different visual parameter.

Visualizer interface showing frequency bars and particle system reacting to bass drop

The tricky part was detecting bass hits without false positives. A fixed amplitude threshold fires constantly during sustained notes. What worked better was a rolling energy baseline — I look for sudden spikes above that average, which gives clean transient detection even as the overall loudness shifts.

Visually, I went with a particle system in Pygame + OpenGL. Bass hits burst particles outward from the center. Spectral flux — basically how fast the frequency content changes — drives a slow hue rotation so the whole scene shifts color as the track evolves.

Performance-wise, 2048-sample windows with 50% overlap kept things responsive at 60fps without killing the CPU. Nothing fancy.

It's not a finished product, just a fun experiment. Stereo separation is ignored, there's no rhythm analysis, and dense drops sometimes turn into a visual mess. But it does what I wanted: when the bassline hits, something happens on screen that actually matches it.

The code is rough but the idea is simple enough to build in a day if you're curious.