Device test · Audio
Pitch Detector
Play or sing a note and this page reports the strongest periodic component it can find in the sound reaching your microphone: the note name, how many cents sharp or flat it sits against A4 = 440 Hz, the frequency in hertz, and a clarity figure saying how periodic the signal actually was. It refuses rather than guesses — silence, sound with no steady period, and anything landing outside 60–1600 Hz each get a refusal that says which measurement failed. Audio stays on this device and nothing is uploaded.
Need something to tune against? This page listens and plays no sound; when you want a reference tone, that is the Tone Generator's job — it states its level and duration and carries the hearing-safety copy that belongs with them.
Idle. Press start, allow the microphone, then play or sing one steady note — the readout fills in once five consecutive measurement windows agree with each other.
Processing state is reported once the microphone is open.
Sample rate is reported once the microphone is open.
Level is RMS in dBFS — relative to digital full scale, not loudness. A browser has no calibrated reference, so nothing here is a sound pressure measurement, and clarity is a periodicity statistic rather than a mark for how the note sounds.
How this test works
When you press start, the browser asks for microphone access and hands this page a live audio stream. The stream feeds one Web Audio analyser, and on every animation frame the page reads the most recent 2,048-sample window and derives two things from that single window: the RMS level in dBFS, which is what the silence gate tests, and a dominant fundamental estimate — the note name, the cents offset, the frequency in hertz and the clarity figure that backs them. Both readings come from the same samples, so the level you can see and the note derived from it are two views of one measurement rather than two measurements free to disagree. Unprocessed audio is requested for every capture, because noise suppression is built to remove the steady tones it reads as background and a held fundamental is exactly that; the line under the controls reports what the browser says it actually applied, which is not always what was asked for.
The estimator is a cumulative-mean normalized difference function, from the YIN family. For each candidate lag inside the band, the first 1,024 samples of the window are subtracted from the same window shifted by that lag, squared and summed; dividing each result by the running mean of every shorter lag turns a raw difference into a periodicity score that does not simply drift as the lag grows. The page takes the shortest lag whose score falls below 0.20 and follows it down to its local minimum — taking the deepest dip instead is the classic octave error, because the octave below a note is periodic too. That rule has a mirror image and the page guards that as well: when a harmonic runs well clear of the fundamental, no lag at the true period ever scores low enough, the first one that does is a fraction of the period, and the note would print an octave or more too high with its cents figure sitting near zero — a wrong note name wearing a perfect tuning. So before interpolating, the page checks whether three times or twice the chosen lag scores substantially deeper and takes the longer period when it does. Depth is what separates the two cases: a signal that really is periodic at the chosen lag scores about four times worse at double it, because the cumulative-mean normalization grows with the lag, while a signal whose real period is the longer one scores an order of magnitude better there. It then fits a parabola through the neighbouring lags for a sub-sample period, which matters most at the top of the band, where a period is about 28 samples and one whole sample of error is worth roughly 63 cents. Clarity is one minus that score, so the 0.80 floor quoted here and the threshold in the code are the same number. The frequency becomes a note by the standard mapping — A4 = 440 Hz, 12-tone equal temperament, sharps only, since D♯ and E♭ are one key and one frequency — and nothing reaches the readout until 5 consecutive windows have agreed within 50 cents, so a scrape, a door or the onset of a word never flashes a note the page cannot stand behind.
The limits are worth stating plainly. The failure class of this whole detector family is the octave error, and the band edges show it. Above the ceiling the page does not refuse, because a 1,900 Hz whistle has a period too short to search but twice that period is inside the band and cancels just as well, so it reads about an octave down. Further up it gets worse rather than staying at an octave: the fold lands on whichever whole-number division of the period first fits the band, so a 4 kHz whistle reads a third of itself at full clarity, and the octave-below reading holds over only part of the range above the ceiling. Below the floor the estimate is refused outright, and the floor itself is set by the analysis window, so at studio sample rates it rises and the page says by how much. Two sounds at similar strength are measured as the mixture they are, and a mixture repeats at a period neither sound has on its own. Everything before the arithmetic matters more than the arithmetic: a microphone's frequency response is not flat, browsers apply processing that this page can request off but cannot switch off, and a room adds reflections and noise of its own. And nothing here is a verdict. There is no score, no dB SPL, and no statement about whether an instrument is correctly tuned — the page reports where a note sits against one stated reference, and the judgment stays with you.