Finally got time to compile [basspitch~] on OSX. Initially, there was this kind of compiler warnings:
basspitch~.c:34: warning: declaration of 'pow' shadows a global declaration
...
/usr/include/architecture/i386/math.h:352: warning: shadowed declaration is here
So I changed all occurrences of variable 'pow' into 'power'.
I had a hard time trying to understand what the code exactly does. But it seems to work (partly, see below). It's interesting that a period longer than the fft framesize can be tracked. A 512 point fft at SR 44100 corresponds to ~86 Hz, and [basspitch~] tracks down to 40 Hz. That is because the second harmonic is sometimes taken to represent the pitch? It is a great advantage because of reduced latency.
It is a nice bass tuner now, but it could be more. You did not test the output as a pitch controller for synthesis, I'm sure! It jumps from tone to tone if you sweep the input frequency. Probably the culprit is this line in perform method:
outlet_float(x->freq, sys_getsr()/(512*16) * fracbin);
This should not be in perform. Instead, you should use a message clock and bind it to a separate method where outlet_float is called. That makes sure every call is indeed executed. Examples can be found in other classes which have signal inlet and message outlet(s).
Katja
Edit: I didn't upload the binary since you may want to correct the code first.