API & MCP
Everything a person can do on Pitch Detector (note and cents from a recording), a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://tonegridpitchdetect.usefulweb.app/api/v1/calculate– run Pitch Detector (note and cents from a recording)GET https://tonegridpitchdetect.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Pitch Detector (note and cents from a recording)
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.
| Field | Type | Default | Description |
|---|---|---|---|
file (required) | file | — | 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 | 0.15 | 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 | 60 | Lowest pitch searched. 60 Hz covers low male voices and bass guitar from B1; use 30 for 5-string bass. |
fmax | number | 1500 | Highest pitch searched |
a4 | number | 440 | Concert pitch A4 |
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://tonegridpitchdetect.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
tonegrid_pitch_detect - Local stdio connector:
node src/mcp-stdio.ts --tool=tonegrid-pitch-detect
{
"mcpServers": {
"tonegrid-pitch-detect": { "type": "http", "url": "https://tonegridpitchdetect.usefulweb.app/mcp" }
}
}