program is made up of the files listed in Table 2.
The core of the color organ code is the FFT (the FFT
code is provided by the audio adapter library) that
converts the digitized audio in the time domain into the
frequency or spectral domain. That is, the audio is broken
out into its component frequencies. Since the audio is
digitized at a 44,100 samples per second rate and there
are 1,024 points in the analysis, each bin is 44,100 / 1024
or 43.066 Hz wide with there being 513 usable bins.
There are an additional 512 bins that are deemed
“unusable” because they represent frequencies above the
Nyquist frequency (see https://en.wikipedia.org/wiki/
Nyquist_frequency for details) which is half the sample
rate. The output of most FFT algorithms are bins of
complex numbers containing real and imaginary parts (for
an explanation of complex numbers, see
pjrc.com audio adapter library converts these complex
numbers and returns a single floating point number
representing the magnitude of the frequency content of
In an FFT spectrum analyzer application, the
magnitude of each bin would be displayed on a screen
which would give a picture of the frequency content of
the signal being analyzed. In our application, we need to
further process the FFT data to make the color organ react
in a more musical way. We do this by lumping bins
together into eight frequency bands that are related by
octaves — a very musical quantity.
Table 3 shows how the FFT bins
are converted into the eight
As you can see in the table,
frequencies below about 43 Hz
and above about 11,025 Hz are
ignored in the current design.
So, whenever new FFT data is
available within the color organ
program, the conversion from bins
to bands is performed and the
resultant values are used to drive the corresponding band
LEDs on the LED string.
Color organs have typically been built into some sort
of cabinet or box, making for an easily transportable
package. That’s what I decided to do, but you might
decide to do things differently. I could see attaching the
120 LED string to the underside of your stereo table or
mounting it around your speakers. The LED strip could
even be mounted in a coffee table. You also have the
March 2017 27
■ FIGURE 5. Configuration screen.
■ FIGURE 6. Misc. screen.
■ FIGURE 3. Teensy color organ circuit board — back
side. Point-to-point wiring isn't pretty but is effective
for one-off projects.
■ FIGURE 8. Files screen.
■ FIGURE 4. Main screen showing
left and right channel VU metering.
■ FIGURE 7. Density screen.