tried to liberally add comments to
my code, to help you figure out
what is happening.
First, by way of a 16-position
switch, a program is selected
(Figure 17). There are three
programs with music driving them
at three different intensities. There
are three programs that make a
laser show without music
controlling it (also at three different
intensities). There are other
programs for setting up the system.
Having a number of programs
made setting all of this up easier,
and was also helpful in
determining frequencies and
amplitudes in the process of
getting it all to work. The different
switch positions combined with
the red and yellow LEDs on the
board made it possible to discover
a lot about how the program was
working, and to find the levels of
noise and maximum amplitude as
a function of frequency. Program 6
gives an example of what I did to
find this. Now that the machine works, the switch is
convenient for making different display programs
and setup routines.
When a program to make musical displays is
chosen, the first step is to retrieve the data from the
graphic equalizer display filter by analog-to-digital
(A-D) conversion. Each channel’s level is a
brightness number for determining what to do with
the lasers. This brightness level is then remapped
through a lookup/lookdown process to remap the
values. Below a value of 25 is noise, so this is all
assigned a value of zero, and the rest of the values
are reassigned to new numbers. Some bands are
not bright enough, so they get a boost. All of this is
done so that each color/frequency-band/laser gets
a more equal treatment as far as the amount of light
from the laser for each channel. There are three
different sets of color maps for dim, normal, and
bright intensity programs.
The brightness values for the lasers are put into
a small loop that turns on each laser for a fraction
of time, which determines the intensity of the color
using PWM. The small loop repeats 10 times. When
a value of the frequency band reaches a peak, the
intensity number is not refreshed for several times
through the big loop to add more “sustain” to the
colors. It is fast enough to catch the beats, and this
delay in the intensity decay keeps it all from being
too jumpy. The whole thing repeats
inside a bigger loop, starting again
with the A-D value retrieval. The
values are refreshed in the bigger
loop about 60 times a second, and
so the lasers are flashed about 600
times a second.
This was a very fun project to
build. I love how the colors express
the different passages in the music.
The colors and the laser coherent
light are really beautiful. Lasers
produce a kind of light that is
different from others, and its
unique character defies description
on paper or visualizing in video.
The interference patterns cause
moving bands of color,
accentuating the rainbow effect.
The Musical Laser Rainbow
Machine brings a new visual
dimension to music. NV
50 May/June 2018
I would like to thank my daughter-in-law, Eli Fox Chaney, for her help in
editing the text of this article.
■ FIGURE 17. List of programs selected
by the rotary switch.
■ FIGURE 16.