Music
Cents between frequencies API
Computes the interval in cents, semitones and octaves between two frequencies using the canonical 1200·log2 ratio — the unit microtuning and intonation work depends on. Answers 'How many cents between 440 and 523.25 Hz?', 'Is this interval a true octave?'.
Price$0.02per request
MethodPOST
Route/v1/music/cents-between
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
musiccentsfrequencyintervalintonationmicrotuningratiosemitonesaudio
API URL
Integration docshttps://x402.hexl.dev/v1/music/cents-betweenExample request
{
"f1": 440,
"f2": 523.2511
}Example response
{
"f1": 440,
"f2": 523.2511,
"ratio": 1.18920705,
"cents": 299.9999,
"semitones": 2.999999,
"octaves": 0.25,
"direction": "f2 is higher",
"formula": "cents = 1200 · log2(f2/f1)"
}Input schema
{
"type": "object",
"required": [
"f1",
"f2"
],
"properties": {
"f1": {
"type": "number",
"examples": [
440
]
},
"f2": {
"type": "number",
"examples": [
523.2511
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}