3 comments

[ 4.3 ms ] story [ 21.3 ms ] thread
You might want to try this one too

https://github.com/aguaviva/GuitarTuner

It uses a bank filter and it also works in the browser

Thanks, I haven't heard of the Goertzel algorithm.

It's a spectrum-based detection though, so it will have the same issues as other spectrum detectors. Lower notes tend to have harmonics that are stronger than the base frequency. At least on a piano. Similar issue with mid-range notes that are fading - the fundamental frequency will fade quicker than the harmonics. There's also a separate issue with detecting higher-pitch notes, because the spectrum response to these is very weak.

That is, spectrum alone is not enough to do any sort of reliable note detection. That's where I started too, but none of simple approaches worked well.

[1] https://en.wikipedia.org/wiki/Goertzel_algorithm