How Pitch Detection Works

Follow a sound from the microphone to a frequency estimate, note name, octave, and cents reading.

From sound wave to note name

  1. 1. Capture a short sample. The browser asks for microphone permission and reads a small window of audio samples. PitchDetector.io processes that window locally; it does not upload the audio.
  2. 2. Find repetition. A sustained pitched sound repeats at a regular interval. The detector compares the sample with delayed copies of itself to estimate the period of the strongest repeating pattern.
  3. 3. Calculate frequency. Frequency is the sample rate divided by that period. A period of about 100 samples at a 44,100 Hz sample rate corresponds to roughly 441 Hz.
  4. 4. Map to equal temperament. The measured frequency is compared with the 12 equal-tempered notes around A4 = 440 Hz. The nearest note becomes the displayed note and octave.
  5. 5. Report cents. The remaining logarithmic difference is shown in cents. One semitone contains 100 cents; one octave contains 1,200.

What affects accuracy?

Signal length

Low notes repeat slowly and need a longer sample before their period becomes clear.

Harmonics

Real instruments produce overtones. A strong overtone can briefly look more prominent than the fundamental.

Room and microphone

Echo, noise reduction, automatic gain, and distance can reshape the captured waveform.

Performance

Vibrato, breath, bow pressure, and string attack cause real pitch movement rather than detector error.

Troubleshooting unstable readings

The note jumps between octaves

Likely cause: Strong overtones can be mistaken for the fundamental, especially during a bright attack.

Try this: Hold one note steadily, reduce brightness or bow pressure, and read the stable middle of the sound.

The meter moves even when the note sounds steady

Likely cause: Natural vibrato, breath pressure, room reflections, and microphone processing all create small changes.

Try this: Move closer to the microphone, reduce background noise, and judge the average center of the reading.

No note appears

Likely cause: The signal may be too quiet, too short, outside the practical range, or microphone permission may be blocked.

Try this: Allow microphone access, play a louder sustained note, and verify that another app is not holding the microphone.

A chord produces the wrong note

Likely cause: A single-pitch detector must choose one repeating component from a sound containing several notes.

Try this: Play or sing one note at a time. Use a spectrum analyzer when you need to inspect multiple simultaneous frequencies.