The "notes" produced by most musical instruments may contain spectral content at a large number of frequencies. Furthermore the frequency spectrum of a "note" may or may not contain significant peaks at what a human would call the musical pitch of the note. So you may not even be asking the correct question.
There's more commentary on this issue in one answer to this stackoverflow question.
A spectrograph (via repeated usage of an FFT or other filter bank) is a common technique for displaying, in graphic form plotted against time, the frequencies contained in captured sound, with a trade-off in time response versus frequency resolution.
There's example spectrograph code in Apple's aurioTouch sample app available from the iOS Developer web site.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…