Frequency Detection

Hi there,

Currently doing an audio visual college project. I need the visuals to react to the audio, I want to have shapes reacting to different frequencies of a sound/sample. I haven’t been able to figure it out.
Is there a way of detecting a frequency range and using it to effect a shape in any way?
Thanks,
Evan.

Hi,
Yes it is possible. You can get the frequencies using the FFT algorithm.
Check the soundPlayerFFTExample example in the examples/sound folder.

Hi Evan,

lilive correctly refers to FFT for analyzing live audio which can be captured from Mic or Line In. In case you want to react to a mp3/wav played by ofSoundPlayer, it would be an option to simply use ofSoundGetSpectrum() - see http://openframeworks.cc/documentation/sound/ofSoundPlayer/#show_ofSoundGetSpectrum

Also, there are simple basic ways if you just want to react to sound level per se and don’t need to react on certain frequencies - see
http://openframeworks.cc/ofBook/chapters/sound.html