How The Online Pitch Detector Works
The detector taps your microphone via getUserMedia, feeds the raw audio into a Web Audio AnalyserNode, and runs a real-time autocorrelation algorithm on each 4096-sample buffer. Autocorrelation finds the period of the signal by comparing the waveform against shifted copies of itself — the lag at which the signal best matches itself is the fundamental period, and the inverse of that period (sample rate divided by lag, with parabolic interpolation for sub-sample precision) is the fundamental frequency in Hz. The frequency then maps to the nearest MIDI note via n = 69 + 12 · log2(freq / 440), and the difference from the integer note is converted to cents using 1200 · log2(detected / expected). Everything runs in the browser — no audio is uploaded.
What "Cents" Means For Singers And Tuning
One semitone is divided into 100 cents. A reading of +10 cents means you are 10% of the way to the next higher semitone — about the smallest deviation an untrained ear can hear in isolation. Professional singers and string players aim for under ±5 cents on sustained notes; choirs and ensembles often allow ±10-15 cents for stylistic warmth. Once you are past ±30 cents, listeners start to perceive the note as definitively flat or sharp. This pitch detector reports cents continuously so you can watch yourself drift in real time and correct your placement — far more useful than a tuner that only flashes red or green.
Why Pitch Detection Sometimes Jumps An Octave
Autocorrelation is robust but not perfect. Low-fundamental voices and instruments (bass voice, kick drum, tuba) often have a stronger second harmonic than fundamental, and the algorithm can briefly latch onto the harmonic instead, doubling the reported frequency. Two cures help: (1) sing or play more loudly so the fundamental dominates, and (2) move the mic closer (15-30 cm) to capture more low-end energy. Conversely, very breathy or whistled tones can confuse the algorithm in the opposite direction. If readings are unstable, try a more sustained vowel like "ah" with steady airflow.
Calibrating Your Microphone For Pitch Work
Pitch detection cares about timing, not absolute level, so a cheap headset mic or laptop mic is fine. What does matter is the input gain — too low and the signal sits below the noise threshold; too high and clipping distorts the waveform and breaks autocorrelation. Open your operating system sound panel and aim for peak levels around -6 dBFS while singing your loudest expected note. If you are not sure how loud your input signal is, run our decibel meter first. To verify the mic itself works, the microphone tester shows a live waveform and peak meter.
Pairing Pitch Detection With Frequency And Hardware Tests
Pitch is just one slice of the audio picture. If a singer or instrument sounds dull on playback even though pitch is correct, the chain probably has a frequency response problem — cheap earbuds and laptop speakers roll off below 100 Hz and above 12 kHz, hiding harmonics that give a voice its character. Run the frequency response test to map your output device. For balance and stereo placement of vocal recordings, the headphone and speaker tester covers left/right, sub, and surround channels. Together these tools cover input pitch, input level, output frequency, and output positioning — the full audio loop.