Available on crate feature
musicxml only.Expand description
music21’s per-element steps of reading MusicXML: what its
MeasureParser makes of one <clef>, one <note>, one <measure>.
Each takes the element’s text and reads it as the whole-document reader reads it in place. A step that depends on what came before it in the measure – a note’s duration on the divisions in force, a rest on the measure it fills – reads the element inside a measure of its own, so that the reader’s own measure logic decides it.
use music21::musicxml::step;
let clef = step::read_clef("<clef><sign>F</sign><line>4</line></clef>")?;
assert_eq!(clef.sign(), Some("F"));
let measure = step::read_measure(
"<measure><note><pitch><step>D</step><octave>5</octave></pitch>\
<duration>2</duration><type>half</type></note></measure>",
&mut step::MeasureContext::with_divisions(2),
)?;
assert_eq!(measure.pitches()[0].name_with_octave(), "D5");Structs§
- Encoding
- What an
<encoding>says of the program that wrote the document. - FitAsked
- What is known of a measure as it goes into its part.
- Measure
Context - What a
<measure>read on its own is read within: what music21’sMeasureParsertakes from the measures before it. - Measure
Fit - How a measure sits in its part: music21’s
adjustTimeAttributesFromMeasure. - Part
Read - A part read, and what music21 warns of as it reads it.
- Spanner
Id - A spanner a
SpannerStateis building, by where it stands there. - Spanner
State - The spanners a reading is building, which outlive one element: the
state music21 keeps in its
spannerBundle. A reading of one element at a time keeps it between elements, as music21’s parsers do. - Spanners
Read - What one step of spanner reading did: the spanners it handed back and the ones it began, and the pedal’s bounces and gaps it put in the measure, each with its uid and offset.
Enums§
- Duplicate
Ids - Whether a spanner of a number already open is joined or another begun:
music21’s
allowDuplicateIds. - Spanner
Step - Which of music21’s spanner-reading steps to take.
Functions§
- measure_
fit - Decides how a measure sits in its part, as music21’s
adjustTimeAttributesFromMeasuredoes. - read_
accidental - music21’s
xmlToAccidental: an<accidental>, or an alteration written by another tag’s text. - read_
appearance - music21’s
xmlAppearanceToStyle: an<appearance>. - read_
articulation - music21’s
xmlToArticulation: one mark of<articulations>,Nonefor one music21 does not know. - read_
barline - music21’s
xmlToBarlineandxmlToRepeat: what a<barline>draws, a repeat in the direction written. - read_
beams - music21’s
xmlToBeams:<beam>s, in order. - read_
clef - music21’s
xmlToClef: a<clef>. - read_
creator - music21’s
creatorToContributor: a<creator>, its type its role. - read_
credit - music21’s
xmlCreditToTextBox: a<credit>. - read_
default_ instrument - music21’s
getDefaultInstrument: the instrument a<score-part>names, before the part’s own names are put on it, and what music21 warns of as it reads it. - read_
defaults_ style - music21’s
styleFromXmlDefaults: the appearance, fonts and lyric languages a<defaults>gives. - read_
encoding - music21’s
processEncoding: an<encoding>. - read_
key - music21’s
xmlToKeySignature: a<key>, as a key signature, or a key where it names a mode. - read_
key_ octaves - music21’s
mxKeyOctaves: the octaves a<key>’s<key-octave>s putsignature’s altered pitches in. - read_
lyric - music21’s
xmlToLyric: a<lyric>. - read_
lyrics - music21’s
updateLyricsFromList:<lyric>s of one note, one numbered nought taking its place among them. - read_
measure - music21’s
MeasureParser.parse: a<measure>, read withincontext, whose tuplets it leaves as the measure ends. - read_
metronome - music21’s
xmlToTempoIndication: a<metronome>. - read_
non_ traditional_ key - music21’s
nonTraditionalKeySignature: a<key>of steps and their alterations, its octaves read too. - read_
page_ layout - music21’s
xmlPageLayoutToPageLayout: a<page-layout>. - read_
part - music21’s
PartParser.parse: a<part>with its<score-part>. - read_
pitch - music21’s
xmlToPitch: the pitch of a<note>, C4 where it has none. - read_
print_ page - music21’s
xmlPrintToPageLayout: the page a<print>starts. - read_
print_ system - music21’s
xmlPrintToSystemLayout: the system a<print>starts. - read_
rights - music21’s
rightsToCopyright: a<rights>, its type its role. - read_
senza_ misura - The text of a
<time>of no meter, where it is one: what music21 reads as aSenzaMisuraTimeSignature. - read_
spanners - One of music21’s spanner-reading steps on an element – a direction
type, a
<notations>, or one slur or other spanner mark – withinstate, which keeps the spanners from one to the next.target, a uid of the state’s, is the note it joins or ends a spanner with. - read_
staff - music21’s
getStaffNumber: the staff an element is written on, nought where it does not say. - read_
staff_ details - music21’s
xmlStaffLayoutFromStaffDetails: a<staff-details>written intolayout. - read_
staff_ layout - music21’s
xmlStaffLayoutToStaffLayout: a<staff-layout>. - read_
system_ layout - music21’s
xmlSystemLayoutToSystemLayout: a<system-layout>. - read_
technical - music21’s
xmlTechnicalToArticulation: one mark of<technical>,Nonefor one music21 does not know; a bend’s release is read indivisionsto the quarter. - read_
tie - music21’s
xmlToTie: the tie of a<note>, where it has one. - read_
time - music21’s
xmlToTimeSignature: a<time>;Nonefor one that only hides the meter. - read_
transpose - music21’s
xmlTransposeToInterval: a<transpose>. - read_
voice_ ids - music21’s
updateVoiceInformation: the voices a<measure>’s notes and forwards are written in, sorted.
Type Aliases§
- Active
Tuplets - The tuplets a part is inside, by number: music21’s
activeTuplets, nought being the one a note’s<time-modification>alone implies.