Determining the fundamental frequency/pitch of a note
Ok, everything was working quite fine, the only thing that I have missed is another formula that is used to get the "real" frequency from the FFT power spectrum. And the formula is as follows:      


  frequency = indexMax * Fs / L;
  where:
  indexMax - index of the maximum in power spectrum;
  Fs - sampling rate of an audio file;
  L - length of the power spectrum array.       


UPDATE
This approach is working fine for such trivial tasks as making a tuner or something like that, but as 


  robert bristow-johnson        


pointed out, this implementation will, in some cases, ignore the fundamental frequency and potentially show you frequency of one of the harmonics. So a better approach would be        


Autocorrelation
AMDF
ASDF
YIN
Mcleod Pitch method