A Lamp That Reacts to Music
19 March 2015
A CD spindle, RGB LEDs, an Arduino, and a beat detection algorithm running on my computer
I wanted a lamp that changes color on the beat of the music, whatever the song style and whatever the volume. Here it is :

The lamp
The lamp is an old CD spindle case, with RGB LEDs I soldered in bands inside. An Arduino in the lamp drives the LEDs, and listens to the computer on the USB port.
Detecting the beat
The hard part is on the computer side, in Processing. The program does an FFT of the sound to split it into frequency bands. For each band it computes two averages of the energy : a long term one and a short term one. When the short term average jumps above the long term one, that’s a beat. Since everything is relative to the long term average, it works with a quiet song as well as with a loud one, and with any style of music.
At each beat the computer sends a random color to the Arduino, and the lamp changes color.
The videos
A first version in October 2014, in a tall column lamp :
The new lamp in its CD case, with the Processing program on the laptop :
And the final version :