Somebody I know did something similar as their masters thesis. They did a FFT and then went through all the frequencies to see whether it was a first or n-order harmonic. It worked pretty well but there was a lot of tweaking involved to handle how various instruments worked.