The compile command compiles valid .pta source to MusicXML.
Syntax
partitura compile <input.pta> <output>
partitura compile <input.pta> -o <output>
Arguments
| Argument |
Required |
Description |
<input.pta> |
Yes |
Input .pta source file |
<output> |
Yes |
Output file path (or use -o) |
Flags
| Flag |
Description |
-o <path> |
Output file path. Takes precedence over positional output argument |
--shape partwise|timewise |
MusicXML document shape (default: partwise) |
Output Format
The output format is inferred from the file extension:
| Extension |
Format |
.xml |
Uncompressed MusicXML document |
.musicxml |
Uncompressed MusicXML document |
.mxl |
Compressed MusicXML archive |
When the extension is .mxl, the output MUST be a valid compressed MusicXML archive.
Document Shape
The --shape flag controls the structure of the generated MusicXML document:
| Value |
Description |
partwise |
Output a partwise MusicXML document (default) |
timewise |
Output a timewise MusicXML document |
Examples
# Compile to uncompressed MusicXML
partitura compile score.pta -o score.musicxml
# Compile to compressed MusicXML
partitura compile score.pta -o score.mxl
# Compile with timewise shape
partitura compile score.pta -o score.xml --shape timewise
Requirements
- Requires valid
.pta input
- Produces MusicXML output in the format indicated by the output file extension
- Supports
.xml, .musicxml, and .mxl output formats
- Fails explicitly when compilation cannot preserve required semantics
- Fails with a non-zero exit code when the input file is not valid
.pta source
Exit Codes
| Code |
Meaning |
0 |
Success |
1 |
Invalid input or compilation error |
2 |
Usage error (missing arguments, unknown flags) |
See Also
- convert — Convert MusicXML to
.pta
- validate — Validate
.pta or MusicXML input
- export — Export to PDF, PNG, MP3, WAV, MIDI