Partitura (.pta) is a compact, human-readable source language for authoring musical scores. It serves as a canonical authoring surface over a semantic model grounded in the full MusicXML specification.
What Is .pta?
.pta is:
- A canonical authoring format for musical scores
- A validation surface for full MusicXML semantics
- A deterministic source for MusicXML interchange
.pta is not:
- An audio rendering language
- A DAW automation format
- A page layout engine
- A general programming language
Design Goals
Partitura 0.1.0 is designed to:
- Support the full MusicXML specification semantically
- Be simpler to read and write than raw MusicXML
- Prefer one canonical source form over many equivalent spellings
- Preserve MusicXML meaning without silent loss
- Diagnose unsupported implementation gaps explicitly
Language Shape
A valid Partitura document has two top-level blocks:
score {
metadata { ... }
part-list { ... }
parts { ... }
}
config {
defaults { ... }
appearance { ... }
print { ... }
import-detail { ... }
links { ... }
bookmarks { ... }
}
The score block is required. The config block is optional and exists for advanced configuration and interchange-preservation detail.
Canonical Example
score {
title "Sonata in C"
composer "Example"
part "Piano" {
measure 1 {
time 4/4
key c-major
clef treble
note c4 quarter
note e4 quarter
note g4 quarter
rest quarter
}
}
}
Key Concepts
| Concept | Description |
|---|---|
| Keywords | English, case-sensitive (score, measure, note, etc.) |
| Blocks | Use { and } with two-space indentation |
| Fields | Written as name value pairs |
| References | Use @identifier syntax |
| Comments | Start with # and continue to end of line |
| Strings | Double-quoted: "text" |
| Booleans | true or false |
| Numbers | Base-10 integers and decimals |
Compact vs Explicit Forms
Partitura provides compact authoring forms for common cases and explicit block forms for full MusicXML semantics:
# Compact form
note c4 quarter
# Explicit form
note n1 {
pitch {
step c
alter 0
octave 4
}
duration 1/4
type quarter
}
Both forms produce identical IR and canonical output.
Next Steps
- Lexical Rules — whitespace, comments, identifiers, strings, keywords, numbers
- Metadata — score-level metadata fields and credits
- Structure — part list, part blocks, measures