musicxml only.Expand description
MusicXML import and export: music21’s musicxml.xmlToM21 and
musicxml.m21ToXml.
MusicXML export: music21’s musicxml.m21ToXml.
to_musicxml writes a score as a score-partwise document, element for
element as music21’s ScoreExporter writes it with makeNotation=False:
the score is taken as already notated, so its measures, beams, ties and
the accidentals it shows are written as they stand rather than worked out
again. A score is parts holding measures, a measure may hold voices, and a
stream holding no parts is written as one part.
ExportOptions::make_notation asks for the notation to be worked out
first, as music21’s exporter does by default: a part of loose notes, or a
score whose lengths no single note value writes, is then written as
music21 writes it.
The writer does no file IO; it hands back the document as a string.
Structs§
- Export
Options - What a document says about how it was made, where the score does not say.
Constants§
- CSS_
COLORS - The CSS3 colour names and their hex values, sorted by name: the table
music21 reads a colour name out of, through
webcolors. - DIVISIONS_
PER_ QUARTER - How many divisions of a quarter note durations are counted in: music21’s
defaults.divisionsPerQuarter,32 * 3 * 3 * 5 * 7, which counts every tuplet music21 writes in whole numbers. - MUSICXML_
VERSION - The MusicXML version written.
Functions§
- css_
color_ hex - The hex value of a CSS3 colour name, as
#FF0000forred, whatever case the name is written in;Nonefor a name CSS does not have. - from_
musicxml - Reads a MusicXML document – the text of a
.musicxmlfile, or of the score inside a compressed.mxl– into a score: music21’sconverter.parsefor the format. - to_
musicxml - Writes a score as a MusicXML document.