FFTW in a msp external
do you have an example of C code of an object that use fftw?
Just to learn the basic use and not taking wrong ways…
Thanks in advance
This isn’t a max/msp external "proper" (and it’s also C++), but the RTcmix fft instruments can be compiled using fftw. See genlib/Offt.cpp for the source.
Hi brad thanks for answering.
I want to perform a fft inside the object.
My goal is to take the maximum magnitude and the relative frequency of an FFT audio signal.
So according to your experience which is the best way? It is the use of fftw?
I searched the RTcmix fft but I have not understood its relation with the fftw!
Could you please explain me?
Can you please also give me some specific useful links where I can study these stuffs you suggested?
Finally wher I can get genlib/Offt.cpp?
You may be able to do what you want using the ‘standard’ max/msp objects (fftin~/fftout~/pfft~), or I’m also a fan of Eric Lyon’s FFTease objects:
but I tend to use the RTcmix/rtcmix~ fft routines because I know them better. But that also assumes you will be doing most of your work "within" rtcmix, which may or may not be what you want.
But if you’d like to see the code, download the main RTcmix source package from here:
and after you unpack it, go to the RTcmix/genlib folder, that’s where the Offt.cpp source code is. To use fftw, you need to set up a ‘plan’ (real-to-complex, complex-to-real) and then execute it on incoming frames of samples (or frames of FFT data). It’s fairly easy to use, as fftw provides functions for doing all this.
For info, check out some of the links here under "FFT Information":
They’re kind of old, but they may help.