forked from: forked from: forked from: Sound Visualizer

To use, call a new instance of BeatMapper:
var myBeatMapper= new BeatMapper(beatNum:Number, isFreq:Boolean);

beatNum= a positive number between 1 and 256. This number of divisions you would like soundwave to split into.

isFreq= false returns a soundwave, true returns a frequency spectrum

All, the beat values (which range from -1 to 1) are stored in the the array named beatValue. You can call on the value of any of the beats in they array by it's index number. In the example below, all the beats value are accessed through a for loop:

for (var j:uint=0; j<myBeatMapper.beatNum; j++)
{
do whatever you want with beatValue[j];

beatX= j*spacing + 15;
beatY= myBeatMapper.beatValue[j]*maxAmp+startPos;
graphics.drawCircle(beatX, beatY, 5);

}//for