Welcome to the developer documentation for the Music Scale Tool backend.
All endpoints are prefixed with /api
. Unless otherwise stated, responses are JSON (UTF‑8).
Method | Path | Description | Query Params |
---|---|---|---|
GET | /pitches/names | List all pitch names (C, C#, Db, …) | — |
GET | /pitches/octaves | List available octaves (0‑6) | — |
GET | /pitches/midi | Convert pitch + octave to MIDI number |
pitch (string)octave (int 0‑6)
|
GET | /pitches/midi/pitch | Convert MIDI number to pitch | midi (int 0‑127) |
curl -X GET "https://musicscaletool.com/api/pitches/midi?pitch=C#&octave=4"
{{
"pitch": "C#",
"octave": 4,
"midi": 61
}}
Method | Path | Description | Parameters |
---|---|---|---|
POST | /scales/create | Create a scale and return MusicXML | JSON body (see below) |
GET | /scales/names | List scale names | type (optional) |
GET | /scales/types | List available scale types | — |
Content‑Type: application/json
. The response is
text/xml
(MusicXML).
{{
"scaleTypeId": 1,
"startPitch": {{
"name": "C",
"octave": 4
}},
"timeMeasure": {{
"beats": 4,
"beatType": 4
}}
}}
curl -X POST https://musicscaletool.com/api/scales/create \
-H "Content-Type: application/json" \
-d '{{
"scaleTypeId": 1,
"startPitch": {{ "name": "C", "octave": 4 }},
"timeMeasure": {{ "beats": 4, "beatType": 4 }}
}}'
Method | Path | Description | Parameters |
---|---|---|---|
GET | /time-signature/beats | List common numbers of beats | — |
GET | /time-signature/beats/types | List beat types (denominators) | — |
curl -X GET "https://musicscaletool.com/api/time-signature/beats"
Invalid requests return errors in the following format with an appropriate HTTP status code:
{{
"error": "Detailed message here"
}}
200 OK
– Successful request400 Bad Request
– Validation failure or missing parameters
404 Not Found
– Endpoint not found500 Internal Server Error
– Unexpected error