Check out the Spectrum.c script.