1st December 2007 05:01 UTC
Music Analyzers
I've been making a few music analyzers: a bar for waveform, a movement (explain later) for the spectrum and a remix of each.
Bar Analyzer:
This was originally going to be for a windows media player clone I was making for WinAmp, but I have abandoned that project because the visuals on media player are horrible. Out of the entire pack, this preset is the best. Each bar is the waveform band 1/50 to 50/50. Using the floor function, each peak indicator is raised up to the height of the bar and an if statement resets the gravity acceleration to 0. This preset works perfectly except the lines dividing the bar are not evenly spaced at certain resolutions.
Spectrum Analyzer:
Instead of having an object that changed its shape based on the spectrum data (like a superscope) I used the following equation in the dynamic movement:
y=y+abs(getspec(abs(x*.65),0,if(above(x,0),2,1)))/10
The closer to the y axis, the higher the pitch is and the farther toward the edge, the lower the pitch is. The if statement corresponds the left side of the preset to the left speaker and visa versa. Using the fadeout, the longer a pixel exists, the fainter it becomes. The gray scale is mapped into color using the colormap; yellow is the spectrum data and blue is the average of the spectrum data. I hope you like it.
Fire Analyzer:
The fire analyzer takes the spectrum analyzer a step farther and maps the oscope data in 2 directions. (the base equation):
y=y+getosc((x+1)/4,0,0)/10;
x=x+getosc((y+1)/4+.5,0,0)/10;
This preset is a visual expression of the shape of the wave form data; a flute would make smooth fire while heavy metal makes twitchy fire. Soft music makes a candle and loud music make a fireplace effect. What I’d really like to do is record the spectrum data every beat and transition from one beat to the next. Another goal is to create dynamic smoke. If you have any ideas on how I could improve any of the preset, please leave a comment.
Enjoy! :D