The code is waaaay over my head, but I see a function called "findAccuratePeakFrequency". Is that using as input something like an array where each occurrence represents a frequency and the value represents the loudness at that frequency? When I first tried to use WebAudio for my little app I tried using input like that and simply looking for which frequency bucket had the highest number. That didn't work well at all. Is this function, though, using the same kind of input but using more complicated math to get a better answer?
Then I switched to very simple autocorrelation and then I switched to a fancier autocorrelation-based method called "Yin".
Also, There's also a comment "The logarithmically binned spectrum has a resolution of one cent". Does that mean that there is a bucket for each 1 cent? When I was using WebAudio I think the the buckets were something like 14 units of frequency apart (hz?), and I didn't discover a way to get finer resolution.