LightShow: An ambient music visualizer

September 9, 2012

Idea

There is something about visualizing music that captivates me - this is the reason why I have attempted so many times to make an oscilloscope for music visualization (perhaps this will be published later). Nonetheless the oscilloscope projects were somewhat anti-climactic because the reliable oscilloscope (using a CRT) has a very limited display area, while the laser oscilloscope could illuminate an entire room but is highly unreliable and barely represents the music. Thus a solution using full-color (RGB) LED lights, along with the Xenon strobe light and possibly an ultraviolet light, connected to a programmable USB controller, seemed like the best fit. I guess the system could be used to create a 'party' setting but I made it simply out of the interest in visualizing music and having the color of the room change along with the beat of a song, etc. Additionally, implementing this system would allow for great ambient lighting even without music, that is a custom color tone or pattern illuminating the entire room.

Supplies

Construction

The first part of construction was putting together the USB controller hardware. I bought the kit at chromationsystems so this step was quite easy, just soldering components to the board. Then the 16 RGB LEDs were installed with the common anodes soldered together.


The finished LED controller board, with 16 RGB LEDs installed and a USB cable connected in the top-right corner.

Next was the fun part of programming the entire system, including the computer sound processing software, and the on-chip LED control and USB communication software. This is explained in the software side of the project (see link under Supplies). I programmed a fast communication algorithm which was tested successfully at 180 packets per second (each containing 1 byte of data for each of the 48 channels), and designed the computer program to control red light corresponding to bass levels, blue corresponding to mid, and green corresponding to treble. Then based on the frequency in a FFT, a specific LED was chosen for each frequency. This provided a robust music visualization scheme.

However, while the LEDs changing color was nice to see, it was not as cool as I expected. I ordered 100 more RGB LEDs to see if that will increase the effect, but in the meantime I decided to make the Xenon strobe light I put together previously do something useful when under computer control. Originally it would flash on its own, based on a pre-set frequency. I was hoping to connect it to the LED controller, and control it from the computer to match the beats of a song.

Doing so would require an isolation circuit since I would not want 120V mains present at the sensitive USB controller. I used an isolation transformer (1:1 winding) partly for safety but mostly so that a DC signal would be converted into a pulse, since having a long 'on' signal in the strobe light would destroy the SCR which would be handling a lot of current continuously. It was designed for pulse loads and the transformer (with a flyback diode) would ideally convert a long DC signal into a single pulse. The pulse from one side of the transformer would turn on an SCR that would ionize the gas in the xenon tube and create a strobe flash. The other side of the transformer would be driven from a controlled voltage source - I used a 9V battery with transistors since the LED controller by itself did not supply the necessary current for the pulse to be registered on the other side.

Thus one channel of the LED controller was connected to the gate of transistors (two to handle higher currents) which would allow the 9V battery to conduct through the transformer, creating a pulse and making the strobe flash. A flyback diode on the control side of the transformer would prevent damage to the transistors, and a similar diode on the pulse side would prevent a reverse bias on the SCR.


The strobe light control circuit, showing the 9V battery, connection to LED controller, and a manual pushbutton switch with a capacitor/resistor in series to prevent excessive current draw on the 9V battery.

Next, re-programming the PC software was necessary so that one channel would be the strobe light and would not be PWMd but instead would be only pulsed once per beat of the music. This channel was made to correspond to the highest frequencies, thus effectively activating on cymbal or hi-hat sounds.


The xenon strobe light inside the transparent box, and to the left, the control circuit and 9V battery. This circuit is then connected to the LED controller and acts like a regular LED in terms of current requirements.

Results

The project has worked successfully so far, and the beat tracking works quite well as you can see in this video. The featured song is the introduction to Basique by Little People and the strobe light matches all the beats. However with the bright strobe light taking over the show, it is necessary to add more LEDs, so I have ordered 100 RGB LEDs to add to the controller.