We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Ess: Strange Differences in FFT Behavior
Page Index Toggle Pages: 1
Ess: Strange Differences in FFT Behavior (Read 607 times)
Ess: Strange Differences in FFT Behavior
Jan 13th, 2010, 2:13am
 
I've got some audio-reactive Processing sketches that I'm rendering to video. To do this, I have a simple class that handles audio input which can take either a sound file on disk or live audio input. It leverages Ess to do this, by loading the sound file into a float array.

I feed audio output from iTunes into Processing by using SoundFlower, which routes the system's audio output back to its input using a kernel extension. I have the iTunes EQ turned off, so what's going into Processing should be only what's in the audio file.

However, I've noticed a slight difference in the values of the FFT depending on whether the audio data is coming from the audio file or live input. Specifically, when analyzing live input, the behavior is more dynamic, whereas file input has a flatter spectrum. The end result of this is that a song that my sketch reacts very nicely to in realtime doesn't look so good when rendered to video.

I have no idea where this discrepancy is coming from. I suspected it might be some manipulation on SoundFlower's part, so I had Ess record its audio input to disk, and then compared the spectrum of that against the original song file in Audacity. They were identical. I'm creating exactly the same FFT regardless of input source, so that's not it. I'm stumped.

Might there be some difference in how Ess's FFT handles sample data from a float buffer versus an AudioInput that I'm unaware of? Has anyone run into this problem?
Page Index Toggle Pages: 1