Drive video effects based on frequency of audio file

Jeremy Billauer's icon

I'd like to manipulate various videoplanes based on the occurence of various frequencies in an audio file.

For example, when the frequency of the audio file is 2000 Hz then do something but when it's 2500 Hz do something else.

I've been looking at fzero~ but for some reason the minfreq and maxfreq attributes are not limiting the output.

Thank you!

mzed's icon

fzero's minfreq and maxfreq are working for me in this minimum test patch:

Max Patch
Copy patch and select New From Clipboard in Max.

fzero can sometimes guess wrong, though. In that case, you might see an output you weren't expecting.

Jeremy Billauer's icon

Hey MZED thanks for the reply.

I hooked my bang up differently that you have. I had it hooked up to the third output (bang ) - onset detected which seemed to be the logical place to do it. That may have been where I went wrong. I'm a little confused now, any idea when that third output should be used?

Also, it seems like the freqmax is limited at 2500 but the freqmin can go as high as I want. I thought this was weird since it says it's based in Hertz and the range for humans is 20 to 20k so it should be able to go that high, right? Any idea on why that is?

Thanks again for your help!

mzed's icon

The way fzero~ works with wavelets involves a fair bit of downsampling. So, it isn't really going to be accurate above 2500 Hz. You might have better luck with sigmund~ or analyzer~ or some other fft-based pitch tracker if you need that range.

That behaviour from the third outlet seems buggy to me. Freqmax seems to work, but not freqmin? I'm not getting very good results from my test patch.

Roman Thilenius's icon

"based on the occurence of various frequencies"

if you dont need tro track changes in frequency but only measure, for example, in which area the most power or peak is present at this time, try bandpassfilters.