xavriley I've also had good results with Q lib's bitstream autocorrelation for tracking violin. There are a couple of problems I have with it though it is my pitch detector of choice.
The problem with lowest_freq
and highest_freq
comes when the instrument being tracked has a large range. The BACF buffer is set >= size of the lowest_freq to allow the low notes to be detected. The issue comes when you play notes 2 or 3 octaves higher than the lowest_freq. In that case you have a buffer substantially larger than it needs to be, full of 2 or 3 times more information to process than is necessary. In practice I've found that BACF takes substantially more cpu to process higher notes than lower ones, given the same buffer size. In theory maybe the buffer size could be automagically varied depending on predict_frequency()
or what is found in the first part of the buffer but, last I checked, predict_frequency()
was not working.
The other significant issue I had is that once BACF believes it has detected a note it will not retrigger to what appears to be a harmonic of the detected note. I believe this is so a decaying guitar note doesn't retrigger to the 2nd harm as the fundamental looses energy, makes a lot of sense and has worked well in Joels guitar tests. The same also applies to sub-harmonics of the detected pitch. For me, on violin, the problem is my note onsets often cause BACF to detect the 2nd harmonic and then stubbonly refuse to change to the fundamental, once it has become established, as it is believed to be a sub-harmonic (which seems odd to me as I don't believe in natural subharmonics unless it is a difference tone between 2 notes). Seems that these sort of detection optimisations quickly become instrument dependent. It depends on how the harmonic spectrum changes in the attack and decay phases, the guitar does one thing, the violin another and the contra-bassoon may do something else entirely.
I communicated these issues to Joel September last year so there may be progress, though I promised I'd send him some violin recordings to test and forgot, oops. Haven't done a recent pull and test but thanks for putting it back in my consciousness! Looking forward to seeing how it does in your tests, especially if it leads to some good ideas for improvement.