[gen] [sharing FFT] global experiment on FFT manipulations
Hi all,
I've been working on trying to get as much fft processing into one gen codebox as having many pfft is very CPU expensive, and seems it would be nice any of you could contribute to this hopefully ever growing set of processings. These all took heavy inspiration on the gen fft examples, with 'many' tweaks here and there.
I need to mention a few things.
- I managed to re-scale the bins in a more musical way
I used this weird formula
bin = pow (originalBin/fftsize, .125);
//bin += binModulation;
bin = scale (bin, 0, 1, -80, 112); // 96 steps
bin = floor (bin);
bin = wrap (bin, 1, 96);
this allows to get 96 more relevant bands, I'm sure there's better ways to do it, but it seems to work pretty well.
it allows to modulate how the bins will be used later on with this binModulation input. (there's an approximate example using two cycles, this could be greatly expand, even having a set of modulators per processings.
- all the processors work per band, like the delay example or the old forbidden planet thing.
This allows to freeze, rotate, delay, filter some bands creating some pretty complex spaces.
- the codebox structure is repetitive and you may hopefully understand how it works, there's no comment annotation, but you can ask any questions...
I hope you'll all enjoy it as much as I do, it seems a powerful set of tools, I'll try to expand it later one.
cheers !
the pfft patch is called pfft.BFspectral
and here is the hopefully not too messy main patch
oh that's lovely, will be taking deeper and deeper dives into this ongoing. especially the bin rescaling formula.. seems to remap the frequency spectrum bin-by-bin according to this curvature:

thank you! 🙌
nice to see you chime in. I'm pretty sure there's a clever way to remap the bins. the scale with a negative bottom is here because if remapped starting at zero, there's way too much room given to sub-audio range. maybe programming a kind of split to compress those very low frequencies to one slider could do the trick.
it would be nice to really know how much bands the scaling can do to be able to chose the number of bands we want. It could be very useful in a multiband- processor context. I'll take a look at it and try things.
but thanks anyway for you interest !
This is really nice - think I'll base a project out of it. Any updates to the code since '21?
I'm less into using max/msp these days, I'm coding jsfx in reaper.
so... I expanded ideas of other FFT processing, but it would be long to translate in max. (and it would be way less efficient) I think it already was a fine set of tools anyway.
I'm curious to see what you will make out of it, if you don't mind sharing then.