I have some LEDs installed in my house, and I'd like to make them dance to music.
My setup:
- 10 RGB LED strips (so 30 channels) controlled by PWM (48 steps) connected to a PC via USB.
- The LED strips are physically located in 4 groups
- Hardware is controlled by Node.js.
- Music is played out of Traktor on a different machine.
- Traktor provides MIDI data out with master tempo and level.
- I have the MIDI data forwarded to the Node server over UDP.
I've written a library to abstract control of the LEDs, so in Node, I can just call:
channel[n].set(intensity, r, g, b);
...and it handles optimizing the data sent over the USB bus.
So on my Node server, I have music tempo and level data coming in, and want to translate that into a light show. Node gets the current audio level about every 60ms. The data looks like this (20 second sample from the middle of a song, click for bigger):
http://josh3736.net/images/ledviz.gif
The MIDI data is output on a scale of 0..127. In this case, the tempo value of 42 corresponded to a BPM of 128.
There are multiple parts to this question that can be addressed:
- Most importantly, what is the best approach to use this data to control the LEDs?
- Ideally, that input data should influence an animation/transition between colors; however, on hard hits an abrupt change/strobe might be nice too.
- Is there any other MIDI data from Traktor I should send to Node?
- How can I keep each of the 4 physical groups biased toward the same color?
Links of interest: