I have not used notefreq(), but I do know there are quite a few algorithms out there that do it; it mainly depends on your needs. As WMXZ said, there is a nice link to the discussion with almost every source (from YIN to AMDF, to full autocorrelation algorithms) to do what you are asking for...