The Audio

The audio analysis is obviously one of the most integral parts within a project that works with music and sound. It was therefore important to focus on this at the earliest stage of development. The idea originally was to have semi-accurate beat detection controlling the movement of objects on the screen. However as development time decreased, and a change of direction was formed, and there was less emphasis placed on the audio analysis. Instead of accurate beat detection, only semi-accurate was developed, and analysis of low/medium/high and overall volume levels was used. As the final version aimed to be a prototype, this suited the purposes of the original goals

The Technique

The audio analysis made use of the sonia audio library for processing, as well as the soniahelper 'hack' which smoothed out the FFT results and provided a more consistant result. The basic process for my Audio Analysis is as follows :

The Audio is recieved via the audio-input setting on your computer ( Microphone, Linein, Microphone set to Wav ), This data is interpreted by Sonia, and turned into a selection of FFT ( Fast Fourier Transform ) values. The Fourier Transform produces a Spectrum - it saves the magnitude of each frequency. All of this information is saved within an array, divided up into 512 Bins ( 512 is the number I chose ).

This data can then be intepreted in any way I see fit. In order to do Beat Detection, there is some more computation involved : The FFT stream must be divided into X segments ( I chose 6 ). The sizes get larger the further right you move into the stream ( ie, Bass to Treble ). For each of these "zones" I then calculated the average value, and a "threshold value" based on the average. If the average value moves higher than the threshold, then that constitutes a "dramatic" increase in that zone, and (quite possibly) a beat.

There are obvious flaws in this solution, however it was the best option I could find for *live* beat detecting

The Implementation

After doing all of this, I didn't actually end up using the beat detection. Instead I focussed on a more simple alternative. I broke the "zones" into segments, one for 'low', 'medium' and 'high' values. Each of these values could be accessed by the user and applied to any property of the graphical element selected. The Beat Detection *is* still in there in "beat mode" however it is not always accurate and is only a demonstration.