I've been thinking about potential improvements to this project lately...
If I compare this to the Sonnus G2Midi, the main gap is the fact that this project is not able to track pitch changes after the note attack. So no bends, no pullups, no hammerons, no slides. (well.. BIG hammerons should work)
The way the current algorithm works is not allowing this, because the pitch is not continuously tracked, but it is only measured during the initial attack of the note, and then only the amplitude is tracked to determine when to end the note or start a new one.
So the flow is something like:
Amplitude tracking -> New note detected -> Velocity calculation -> Pitch determination -> Amplitude tracking -> New note or end note -> ......
This is done this way with the assumption that at the beginning of the note, right after the pick, the fundamental frequency will be strong enough not to be messed by the harmonics. But if we continue to track pitch with the used algorithm (zero counting), at some point during the note decay harmonics will be strong enough to mess up things.
If I want it to be continuously tracking, I see 2 options: Modify the algorithm or add some hardware to do part of the job in order to remove the harmonics.
Regarding changing the algorithm, I've been thinking around other pitch detection techniques that can live with the extra harmonics, like FFT and Autocorrelation, but definitively there is not enough horsepower with the 16f88 to do such a thing.
Regarding adding some hardware, I was thinking on using something like the OC-2 fundamental extractor. This could give a better tracking, but would eliminate the dynamics, so no amplitude tracking anymore (no velocity calculation possible). A potential solution could be to combine the original signal envelope with the fundamental extracted by OC-2, using a compandor or something similar, so that we get the fundamental frequency but the dynamics of the original signal.
But after some thought, I think it would be easier to simply use 2 DAC channels of the PIC and input into them both the fundamental (from the OC2) and the original signal (or maybe an envelope of it). This way the PIC will still be able to continuously monitor pitch and amplitude.
On the other side, I'm trying to understand how the OC2 fundamental extractor works. I wonder if the same principle of fundamental extraction could be used on the software side, and avoid adding more hardware to the thing...
What do you think?