{"uid":"cap_35FYPKm83nAuoGYGXumQV","slug":"music-theory-frequency-to-nearest-note-cb72cebd","name":"Music Theory: Frequency to Nearest Note","description":"Frequency in Hz to the nearest note, MIDI number and offset in cents; adjustable A4 reference; tuner-style result.","url":"https://music-theory.x402tookit.com/freq-note?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["hz"],"properties":{"a4":{"type":"number","description":"Reference pitch for A4 in Hz, 400 to 480 (default 440)"},"hz":{"type":"number","description":"Frequency in Hz, 8 to 14000"},"accidentals":{"type":"string","description":"sharps (default) or flats for the note name"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"a4Hz":{"type":["null","number"]},"asOf":{"type":["null","string"]},"midi":{"type":["null","number"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"direction":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"centsOffset":{"type":["null","number"]},"frequencyHz":{"type":["null","number"]},"nearestNote":{"type":["null","string"]},"fractionalMidi":{"type":["null","number"]},"nearestFrequencyHz":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_kOr-XTCzwzWIQGPAsLEdP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a frequency in Hz to the nearest musical note, MIDI number, and cents offset, with adjustable A4 reference pitch.","exampleAgentPrompt":"What's the nearest musical note to 432 Hz, using A4 = 432 as the reference, and tell me the MIDI number and how many cents off it is?","exampleUseCases":[{"title":"Instrument tuner pitch check","prompt":"I'm recording a guitar that's slightly out of tune — the string is ringing at about 329 Hz. What note is that closest to, what's the MIDI number, and how many cents flat or sharp is it?"},{"title":"Verify synthesizer oscillator pitch","prompt":"My synth is outputting 880.5 Hz. Can you tell me the nearest note name using sharps, the MIDI note number, and the cents offset from the true pitch?"},{"title":"Analyze historical tuning reference","prompt":"If I'm working with baroque music tuned to A4 = 415 Hz and I have a frequency of 415 Hz, what note does that correspond to, what's the MIDI number, and what's the cents deviation?"}],"resultDescription":"Returns the nearest note name (e.g. A4, C#3), MIDI number, fractional MIDI, cents offset from the nearest note, the nearest note's exact frequency in Hz, the A4 reference used, and metadata such as a summary and direction (sharp/flat).","failureModes":["Frequency out of range (below 8 Hz or above 14000 Hz) returns an error","A4 reference out of allowed range (400–480 Hz) returns a validation error","Missing required 'hz' query parameter results in a bad request error","Invalid accidentals value (not 'sharps' or 'flats') may cause unexpected behavior"],"whenToPreferThis":"Use this endpoint when you need to identify the musical note, MIDI number, and tuning deviation for a raw frequency value — ideal for tuner apps, pitch analysis, instrument calibration, or translating audio frequency measurements into musical context. Prefer this over a note-to-frequency endpoint when the input is a raw Hz value rather than a note name.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:40:51.850Z","isFirstParty":false,"canonicalSlug":"music-theory-frequency-to-nearest-note-cb72cebd"}