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.
https://github.com/aguaviva/GuitarTuner
It uses a bank filter and it also works in the browser