Skip to main content

score_header_xml

Function score_header_xml 

Source
pub fn score_header_xml(
    score: &Stream,
    options: &ExportOptions,
) -> Result<Vec<String>>
Available on crate feature musicxml only.
Expand description

What music21’s ScoreExporter writes before a score’s parts, element by element: the work and movement titles, <identification>, <defaults>, a <credit> for each text box and the <part-list>.

A score with nothing in it is written as a part of one empty measure, rather than as the blank page super::to_musicxml writes for it, so that what is written is what the score and options say.

use music21::{Stream, StreamKind};
use music21::musicxml::{ExportOptions, score_header_xml};

let header = score_header_xml(&Stream::with_kind(StreamKind::Score), &ExportOptions::default())?;
assert!(header.iter().any(|element| element.starts_with("<identification>")));
assert!(header.last().unwrap().starts_with("<part-list>"));

§Errors

What writing the score refuses.