read_score
Read MusicXML files to extract pitches, notes, and structure measure by measure. Use bar filters for targeted sections, returning a structured dictionary for offline analysis.
Instructions
Read an existing MusicXML file measure by measure using music21.
Entirely offline and read-only. This is the way to see pitches, which Dorico
itself will not report over the Remote API.
Returns:
Structured dictionary with the metadata, parts, measures and note events.
Note:
Use the bars filter rather than reading everything when the question is
local: a full read of a long score returns every note of every part.
To see the music currently in Dorico, export it with export_musicxml first
and read that. read_project_info reads a .dorico project wrapper instead,
and read_selection reports the live selection without pitches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bars | No | Which bars to read, as a filter string: '8' for one, '8-12' for a range, '8,10,12' for a list. Bars are counted from 1. Omit to read the whole score, which on a long one is a lot of output. | |
| path | Yes | Filesystem path to the MusicXML file to read. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||