Here's the results (so far) of some experiments I've been doing using a variation on Martin's correlation method.
In this case it is a 'mutated' idea stolen from the way FFTs work. Rather than auto-correlating with a delayed copy of the original signal, the audio is correlated with a bank of quadrature oscillators - i.e. the combined correlation with both the sine and cosine function of the desired frequencies.
I chose this because the quadrature oscillators can be programmed with a very small chunk of code (as long as the sines/cosines are calculated in green) - it's using about 2-3% of my Q6700 CPU to scan 8 octaves of semitones, despite using no hopping at all.
So far, I'm just using the correlates to drive a funky frequency display - I need more time to study martin's clever code for deriving the root frequency using the weightings and interpolation.
You'll also see that there is an audio output. As the design is based around FFT ideas, I wondered whether the inverse function could be calculated to reconstruct the original signal. It works surprisingly well, despite not using sub-harmonics of the sample rate (as a true FFT would do). It can even make a very crude polyphonic pitch shifter - though a bit noisy (I think because the quadratures are not locked in phase to the sample rate?)
Still needs some work - the quadrature oscillators are free running, so the accumulation of rounding errors eventually makes it unstable (
watch your speakers/ears!!) - when you see the Freq display start to get a bit random, you can press the PANIC button to reset the oscillators.
The main module has 3 other inputs...
-Base Frequency. The lowest freq shown on the display
-Averaging. Scale up the time that the correlation is averaged over - can get some nice 'harmonic resonator' sounds with long settings.
-Scale. Magnifies the display.
Next thing I'm looking into is using the proper FFT sub-harmonics - I think a very efficient sin/cos lookup-table should be possible, knowing that the table would always be indexed in integer numbers of samples, which ought to solve the instability problems. Still not as efficient as a true FFT, don't think, but at least it could be done all in streams.