Not sure if I realy made myself clear in that last post! Sorry!
So, Essentially what I'd like to do, is load up an external sound file, and display the spectral data for the complete file. Similar to opening a audio file in a music / sound editor and getting this :
Currently I'm using Sonia, and I'm using the following code to recieve the data ... I assume this is the correct way to do it ?:
Code:
data = new float[mySample.getNumFrames()];
mySample.read(data);
( Either data or readChannel ). This of course returns an array with the number of sound frames contained within the file, but my Processing width is only so big - So in order to actually *display* this, I either have to ignore a lot of the frames, or find an average.
Both turn out ... oddly though.
That version is drawn using the following code :
Code:
int avgVal = (data.length/width);
for (int i=0; i<width; i++){
line(i,middle,i,middle+(data[i*avgVal]*middle));
}
( where middleis the mid point of the y axis )
So is there any way to make my version look more like the above version ?
Thanks! Hope that makes more sense...