Code for Audio Analysis Mode
Here is some code to do audio analysis on the Saikoduino using the MSGEQ7. It should work with other arduinos using the MSGEQ7 as well.
This version does automatic noise thresholding and compression to basically do noise removal and automatic gain on noise. These features let you use the same code on lights with different microphone sensitivity and in different scenarios (quiet room they’re very sensitive versus concert venue where they’re much less sensitive).
The LEDs are only controlled in 8-bit mode in this example. I had some trouble reconciling the timers used in the ADC with the PWM outputs. It may be solvable, but I haven’t solved it yet.