An update of my MusicalColours script to provide lighting feedback for my TV! Demo’d by playing Halo 4.
The circuit used is the same as before but I have tweaked the code somewhat. I decided I wanted a way of tuning the frequency bands used for the RGB lights, as the previous code required trail and error. I found a Processing library called ControlP5 that provides a GUI, which can be used to control variables. Using it, I have developed sliders, which control the upper and lower boundary of treble, mid and bass.
Unfortunately, the graphical FFT does not work with the sliders due to a different rendering method used. I think it may be fixed in the current version of Processing (2.0) but I found this not to work with the Arduino library (a known bug).
I also started playing around with the linear averages function of the FFT:
It reduces the number of bands and should reduce noise that can cause the lights to flicker. It is also something I was looking at to try and level out the ranges a bit, so they correspond to the analogue voltage better (I’ve also messed around with
map but it doesn’t really work when you don’t know the max value of the input). I didn’t use either in the video above though as I am still trying to get the right number of averages. Current code is attached below (you need to download the ControlP5 Library to use this version)