Decoding fftin~

Brent Lewis's icon

I'm very new to Max and Ableton Live, but I'm curious about the FFT stuff, specifically fftin~. After several failed attempts at making an effect to drop input by one octave, I finally learned about gizmo~ and it worked fine. I'm still finding the data from fftin~ difficult to interact with in an algorithmic way, as I still don't completely understand how pfft~ works. It seems strange that fftin~ doesn't produce a stream of vectors and instead an ordinary signal. I found the sonograph example in the Spectral Processing documentation, but it's a one shot fft. I tried a bunch of other stuff including using the FFT Bin Index output of fftin~, but it all remains mystifying (and sounds aweful).

Please explain how I can get a stream of vectors with the FFT data. How can I manipulate that data?

mzed's icon

The example called "forbidden-planet" shows one way to work with pfft~ data. There are some others in that folder, too.

Christopher Dobrian's icon

The signal from fftin~ is, in effect, a "stream of vectors". The output is spectral information, transmitted in the same form as a time-domain signal, but with a different meaning. If, for example, your FFT size (specified as an argument in the parent pfft~ obejct) is 1024 samples, then every 1024 samples coming out of fftin~ is the real and imaginary values of of one frame of the FFT, and you can access (index) those values using the output from the rightmost outlet of fftin~. See MSP Analysis Tutorial 3 for a basic explanation (using pre-pfft~ objects), and MSP Analysis Tutorial 4 for information about pfft~ with some examples of spectral processing.

Brent Lewis's icon

I've thought about it more and it doesn't make sense to me still. It seems like gizmo~ should not be able to do downward pitch shifting. For the complex-valued fftout~ frequency bin y[i], you require fftin~ frequency bin x[j], where j > i. How do you read future input bins to compute the current output bin?

volker böhm's icon

MSP objects pass their data in blocks of samples (adjustable in audio status: signal vs).
so, inside an external you have access to all samples of a block/vector at once.
btw., that's why you can do tight feedback loops inside an external but not when patching in maxmsp.
note that the pfft object has it's own vector size, which is equal to the current spectral frame size.
hth, v