Help calculating FFT bins for individual cello notes

hi.

i am attemping to use the FFT modules to create visual reactions to individual cello notes.

out of the FFT i would like to get something close to 1 bin = 1 note.

i am using the following formula taken from help patches;

“To retrieve the slice indices from a frequency,
you can use the following formula:
Index = (FFTSize * Frequency) / SampleRate.”

my problem comes in the form of processor power.

in order to get something approaching 1 bin = 1 note at the bottom of the cello’s range i need to have my FFT size at 16384 or above.

the range of the cello goes from about octave 2 - 5, but even if i sample ocates 2 - 7 i am still only going from 65 - 3000 (65hz - 3000hz)

so to get the bins for the cello’s range with my current setup the computer is processing an extra 1300 bins that i don’t need!

is there anyway of only getting the FFT to process the frequency range i need?

or have i just got this backwards?

anyway. all help aprecciated. sorry for the long post. i have attached a patch so you can see my workings. WARNING - its quite big.

… no text …

bin slices for notes.v4p (297.6 kB)

…ok, i’ll take that as a no then.

my next question is: Am i able to get at the source-code for the FFT plugin so i can look to modify it myself?

when you’ll do so (or anybody else), it would be worthfull to have a look at wavelets

Well shouldn’t be much of a problem to have your fft processing the full range (0 to half samplerate), it’s designed to do this fast. I’m not sure if there’s fft algorithms designed to only look for a specific range (as you often need inverse fft to go back to time domain after).

One important part is that you can of course interpolate bins. So if you take note C2 (65.41Hz), and say you have samplerate of 44100Hz, and FFT Size of 2048.

Bin is 3.0376, so you can take 0.9624 of bin 3 + 0.0376 of bin 4

Also by looking at you patch, spreading stuff would come in handy :)

thanks for the replies. something to think about.

‘wavelets’ - interesting, but way over my head. (when i say ‘I’ will take something apart, i mean my programmer friend)

interpolating the bins - i hadnt thought of that. thanks.