I'm designing a simple tuner, so my target is displaying a note name (A, B, F#) and the distance in cents between the theoretic sound and the actual input.
I'm completely new to audio and signal processing, so I did some research and I found a thing called Fast Fourier Transform that will analyze the bytes and will give me the frequency. Also, I found a couple of Java libraries like common math and JTransforms so I won't write the hard code myself.
I believed that's all, since each range frequency can be directly mapped to a note in the equal temperament, but then I found this new (to me) word called pitch: it's said to be tightly related to frequency, but is not exactly the same thing and is much more difficult to get, and belongs to that psychoacoustic area.
So my question is, can somebody clearly outline the differences between pitch and frequency and maybe tell me which a tuner deals with?
It's important to notice the difference between a 'frequency' of vibration and a musical 'pitch'.
A 'pitch' is not a single vibration, such as a sine wave, but is a composite of multiple sound vibrations occurring at different mathematically related frequencies. The elements of this composite of vibrations at differing frequencies are referred to as harmonics or partials. For instance, if we press the Middle C key on the piano, the individual frequencies of the composite's harmonics will start at 261.6 Hz as the fundamental frequency, 523 Hz would be the 2nd Harmonic, 785 Hz would be the 3rd Harmonic, 1046 Hz would be the 4th Harmonic, etc. The later harmonics are integer multiples of the fundamental frequency, 261.6 Hz ( ex: 2 x 261.6 = 523, 3 x 261.6 = 785, 4 x 261.6 = 1046 ).
Below is the image of a Logarithmic DFT for 3 seconds of a guitar solo on a polyphonic MP3 recording. It shows how the harmonics appear for individual notes on a guitar, while playing a solo. For each note on this Logarithmic DFT we can see its multiple harmonics extending vertically, because each harmonic will have the same time-width. (click for image of Logarithmic DFT)
This Wikipedia article gives a good background into the concept of 'pitch' as it pertains to music, and introduces some concepts about pitch detection.
https://en.wikipedia.org/wiki/Transcription_(music)#Pitch_detection