# 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. 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. Part of usefulweb.app (https://usefulweb.app/). Part of [Tonegrid](https://tonegrid.usefulweb.app/) (ownerApp: tonegrid). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://tonegridpitchdetect.usefulweb.app/ (interactive tool at https://tonegridpitchdetect.usefulweb.app/tool) - JSON API: POST https://tonegridpitchdetect.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://tonegridpitchdetect.usefulweb.app/api/v1/tool) - OpenAPI: https://tonegridpitchdetect.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://tonegridpitchdetect.usefulweb.app/mcp - tool `tonegrid_pitch_detect` ## Inputs - file (file, required): Audio file - WAV directly, MP3, FLAC, Ogg, M4A and AIFF via ffmpeg. The first 30 seconds are analysed. One voice or one note at a time works best; chords and drums have no single pitch. Files are not kept. - threshold (number): Periodicity threshold - Lower = only very clean, periodic frames count as pitched (0.10–0.15 suits most recordings; raise it for breathy voices). - fmin (number): Lowest pitch searched - 60 Hz covers low male voices and bass guitar from B1; use 30 for 5-string bass. - fmax (number): Highest pitch searched - a4 (number): Concert pitch A4 ## Method - 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. ## Limits - 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.