How to get the value of freq at n seconds in buffer?

I’d like to get the value of freq at the point of n seconds, after getting sounds from SoundIn.ar and doing FFT -> IFFT. (It may be wrong?)
Is there a better way to do it?
Tried to just plot:

(

{ var in, chain;
	in = SoundIn.ar(0);
	chain = FFT(b, in);	
	IFFT(chain);			
}.plot(5.0);

)
// For example, how to know the frequency that is sounding the most at 2 seconds?

Thanks!

A better approach would be Pitch or Tartini.

Getting a frequency directly from FFT is not trivial. It’s better to use a dedicated pitch tracker.

hjh

1 Like

Thank you!
I’ve decided to use Pitch and gonna make a list of pitches via OSC message from the server.