pfft~ access to single bin
Hey!
I look around in max's help files but I can't find answer form my question.
Do you know how to get access to single bin in fft frame in real time?
Is it possible with max?
Tahanks,
wo
The rightmost outlet of fftin~ gives you the bin index.
Ok :)
But how can I get access to this data? With snapshot~ or buffer~ ?
Let say I want make a simple spectrogram based on fft~ with pfft~ and multislider. What should I put in the middle?
Thanks for help!
It depends where you want to store you data. If you want to make a spectrogram, I suggest you to store FFT data in a matrix (jit.matrix) using jit.peek~ to store and jit.poke~ to read the data. Working with FFT data is sooo much easier and more intuitive when the data is stored in a matrix that I really suggest you to go in that direction.
J.F. Charles published an awesome article in Computer Music Journal back in 2008 called A Tutorial on Spectral Processing Using Max/MSP and Jitter. There are also many accompanying patches to that article...have a search on the web. Priceless source of information!
PS: And you will have to decide between using fft~ or pfft~. There is no point in using both. At least not for what you want to do.
PS2: In case you're not familiar with Jitter, you really need to know just few basics in order to create Spectrogram, so...I would say Jitter is the way forward:)
PS: I am just writing my dissertation on that topic, it will be finished very soon. Detailed description of spectral processing in Max/Jitter...stay tuned, 160 pages already:)
Thanks a million for the great answer!
I will be happy if let me know when you finalize your article.
:)
If you really want to isolate just a single bin (as opposed to displaying the entire spectrum), this may not be the most efficient way imaginable, but it works. (The example uses fft~ instead of fftin~, but the principle is the same.)
@ t: Did you finish your dissertation? I'd love to read it.
Cheers, A
Thanks for the tips t! I'd love to peek at some of your dissertation as well. This is something I've been contemplating pursuing as well!
Jeff
You can use ==~ and sah~ to accomplish this. (as in when the bin# is equal to n, sample the value and continue holding it until the next frame. You can use send~ on this. You may need to divide by the number of overlap since you're adding multiple values together)