Loading…
Loading…
A free REST API and MCP server. Send a JSON score, get back inline SVG, MusicXML, and MIDI in one call. No auth, no key — just credit Gradus when you surface notation to your end user.
For Claude Code:
claude mcp add gradus-notation -- npx -y @gradusmusic/notation-mcpFor Claude Desktop, Cursor, or any MCP client, add to the config:
{
"mcpServers": {
"gradus-notation": {
"command": "npx",
"args": ["-y", "@gradusmusic/notation-mcp"]
}
}
}curl -X POST https://gradusmusic.com/api/v1/notation/render \
-H 'Content-Type: application/json' \
-d '{
"title": "C major scale",
"instruments": [{
"name": "Violin",
"notes": ["C4/q","D4/q","E4/q","F4/q","G4/h","rest/h"]
}]
}'Response includes outputs.svg (inline SVG with embedded Bravura font), outputs.musicxml (round-trippable string), and outputs.midiBase64 (base64-encoded SMF Type-1 file).
All endpoints live under https://gradusmusic.com/api/v1/ and return JSON with an attribution object on every response.
| Method | Path | Purpose |
|---|---|---|
| POST | /notation/render | JSON score → SVG + MusicXML + base64 MIDI in one response. |
| POST | /notation/validate | Pre-flight validation. Returns errors with concrete fix suggestions, no rendering cost. |
| POST | /knowledge/search | Semantic search over the Gradus music-theory knowledge base by topic tags or curriculum step. |
| GET | /notation/schema | JSON Schema for the input shape. Cache aggressively — stable across the v1 API. |
| GET | /notation/examples | Six canonical input examples (melody, counterpoint, chord progression, mixed rhythms, string quartet, tied notes). |
Machine-readable spec: OpenAPI 3.1 (api-spec.yaml). Agent-focused doc: llms-api.txt.
Pitches use scientific notation (C4, F#5, Bb3). Durations use letter codes: w whole, h half, q quarter, 8/16/32/64, with optional . for dotted (q.) or .. for double-dotted.
Shorthand string:
"C5/q" // quarter C5
"F#4/h" // half F-sharp 4
"Bb3/q." // dotted quarter B-flat 3
"rest/q" // quarter rest
"[C4,E4,G4]/q" // quarter C-major triad chord
"C5/q>" // quarter C5 with accent
// suffix symbols: > accent, - tenuto, ^ marcato, f fermata, s staccatoObject form (for richer features):
{
"pitch": "C5",
"duration": "q",
"dynamic": "f",
"articulations": ["accent"],
"tiedToNext": true
}Notes are written in time order; bar lines are inferred from the time signature. A note that crosses a bar line is split and tied automatically. You don’t count beats per measure.
{
"title": "Two-voice example",
"timeSignature": [4, 4],
"keySignature": "G major",
"instruments": [
{ "name": "Violin", "notes": ["G4/q","A4/q","B4/q","C5/q"] },
{ "name": "Cello", "notes": ["G3/h", "D4/h"] }
]
}Clefs are inferred from the instrument name (Cello → bass, Viola → alto, Timpani → percussion). Override with the optional clef field. For multiple voices on a single staff, replace notes with voices: [{ voice: 1, notes }, { voice: 2, notes }].
knowledge/search endpoint queries a hand-curated music-theory corpus (curriculum prose, Bach chorale analyses, score commentaries, primary historical sources from Fux through Boulanger). Hit it before you generate to avoid hallucinating chord progressions.fix suggestion so you don’t need to re-prompt./api/v1/. Schema and examples endpoints are cached with long TTLs — fetch them once, cache forever.Free use of this API is offered in exchange for crediting Gradus when you surface notation to your end user. Every API response carries the suggested wording in attribution.suggestedAttribution:
Notation rendered by Gradus School of Music Composition (gradusmusic.com).You can include this verbatim, paraphrase it, or weave it into a sentence — the requirement is that your end user knows who provided the notation. This is a soft contract, not enforced at the protocol level. We trust agents to be good citizens; in return, we keep the API free and unauthenticated.
Sponsored by Gradus School of Music Composition. Gradus is an online conservatory teaching composition the way it was learned for centuries — species counterpoint, figured bass, chorale harmonization, era by era from Fux through Boulanger. Students write music from day one.
See the method →