Pitch Detector (note and cents from a recording)
Upload singing or a single-note instrument and see which notes it hits and how many cents off.
Try an example: Three sung-like notes with vibrato (A3, C4, E4) · Bass note A2, 20 cents sharp
How it works
Finds the pitch of a voice or a single-note instrument in an audio file with the YIN algorithm: the median pitch with its nearest note and deviation in cents, the sequence of notes held for at least 60 ms, the lowest and highest pitch, a pitch-over-time chart and a CSV track of every 10 ms frame. The same detector as the pitch trainer in the Tonegrid app.
- The recording is mixed to mono and analysed every 10 ms with YIN (de Cheveigné and Kawahara 2002): the difference function of the signal with delayed copies of itself (computed through FFT autocorrelation), the cumulative mean normalised difference, the first delay whose value dips below the periodicity threshold followed to its minimum, and a parabola through that minimum for a sub-sample period. Pitch = sample rate ÷ period. Frames quieter than −50 dBFS or without a dip below the threshold count as unpitched.
- Notes: the nearest equal-tempered note to a pitch relative to the chosen A4, and the deviation in cents (100 cents = one semitone). Note segments are runs of frames with the same nearest note lasting at least 60 ms (a single unpitched frame inside a run is bridged); their pitch is the median of the run.
- The summary pitch is the median of all pitched frames, so short slides and breaths barely change it.
Pitch detection needs one clear voice or note at a time. Octave errors are possible on very breathy, distorted or noisy recordings; chords and drums do not have one pitch.
Sources
Part of Tonegrid
-
Tonegrid Tone matrix & beat sequencer
Light up squares to build melodies, beats and acid bass, then arrange them into songs.
Related tools
- Audio Spectrum Analyzer – Upload audio and see its spectrum, peak frequencies, centroid, RMS/peak and waveform.
- Scale, Chord and Fretboard Finder – Notes, intervals and fretboard positions of any scale or chord — or name the chord you play.
- Audio Cutter & Merger – Trim audio, keep or remove ranges, fade in/out, or join up to 10 clips with crossfades.
How to use the Pitch Detector
Upload singing or a single-note instrument and find its notes, the median pitch and how many cents sharp or flat it is, with a pitch chart and a CSV pitch track.
What it is for
The Pitch Detector tells you which notes a recording contains and how far each note is from the equal-tempered pitch. Use it to check a sung phrase, a bass note or a whistled tune, or to find the key of a melody you recorded. It works on one voice or one single-note instrument at a time.
The file is mixed to mono and analysed every 10 ms with the YIN algorithm (de Cheveigné and Kawahara, 2002). YIN compares the signal with delayed copies of itself and picks the shortest delay at which the signal repeats. That delay is the period of the note, and its inverse is the pitch. The Ear trainer of the Tonegrid app uses the same code for its sing-back drill and its "Analyse a recording" panel.
Worked example
The first example is a synthetic voice that sings A3, C4 and E4 for about half a second each, with vibrato. The result reads "Median pitch 262.11 Hz = C4 +3.2 cents; 3 notes held for at least 60 ms; 87 % of the frames are pitched". The note table lists:
| Start (s) | Note | Pitch (Hz) | Cents |
|---|---|---|---|
| 0 | A3 | 220.38 | +3 |
| 0.521 | C4 | 262.07 | +2.9 |
| 1.052 | E4 | 330.25 | +3.2 |
The gaps between the notes are not pitched, which is why only 87 % of the frames count. The notes were generated exactly in tune, with a vibrato of ±8 cents; each note stops during an upward swing of the vibrato, so the median of every note lands about 3 cents sharp. That is a real property of the signal, not a measuring error.
The second example is a bass note A2 that was tuned 20 cents sharp. The tool finds 111.25 Hz, A2 +19.6 cents, in 100 % of the frames, and the pitch varies only between 111.24 and 111.26 Hz.
How to read the result
- Median pitch is the middle value of all pitched frames, so a short slide into a note or a breath barely changes it.
- Cents measure the distance to the nearest note: 100 cents are one semitone. Positive means sharp, negative means flat. Trained singers usually stay within about ±20 cents.
- Notes held for at least 60 ms are runs of frames with the same nearest note. Shorter notes and slides are left out.
- The chart shows the pitch over time against note lines. The CSV pitch track has a row every 10 ms with time, frequency, note and cents.
Tips and common mistakes
- Record close to the microphone in a quiet room. Reverb and background music cause wrong or missing frames.
- Chords, drums and full songs do not have one pitch, so the result has no musical meaning.
- If notes come out an octave too low, raise Lowest pitch searched. For a 5-string bass, lower it to 30 Hz.
- For breathy voices, raise the Periodicity threshold to 0.2–0.25. Lower it to accept only very clean frames.
- If your band tunes to 442 Hz or 432 Hz, set Concert pitch A4 accordingly; the cents are then measured against that tuning.
FAQ
How accurate is it?
On clean test tones (sine, sawtooth, square and triangle from 62 Hz to 1 kHz) the automated tests require an error below 0.1 cent. The A2 example above, stored as a 16-bit WAV at 16 kHz, was made 20 cents sharp and is measured at +19.6 cents. Real recordings add noise and room sound, so expect a few cents of spread there.
How long can the recording be?
The first 30 seconds are analysed. Trim long files to the part you are interested in.
Is my recording stored?
No. The file is processed for this request only and not kept. In the Tonegrid app the analysis even runs in your browser.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://tonegridpitchdetect.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://tonegridpitchdetect.usefulweb.app/mcp· tool nametonegrid_pitch_detect
Example request
curl -s -X POST https://tonegridpitchdetect.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'