I/O functions

readmusicxml, parsemusicxml, writemusicxml, printmusicxml, pprint, fwritemusicxml, readmusicxml_partial, parsemusicxml_partial
MusicXML.extractdata — Method
extractdata(doc)

Extracts musicxml data, builds all the types and stores them in proper format.

This function is not exported. Use readmusicxml and parsemusicxml instead.

Examples

data = extractdata(doc)
MusicXML.parsemusicxml — Method
parsemusicxml(s)

Parses musicxml from a string and then extracts the data, builds all the types and stores them in proper format.

Examples

data = parsemusicxml(s)
MusicXML.parsemusicxml_partial — Method

Similar to parsemusicxml but without converting it to a Julia type. Use the appropriate type to convert it

Examples

xml_note = parsemusicxml_partial("""
<note>
  <grace/>
  <pitch>
    <step>G</step>
    <octave>4</octave>
  </pitch>
  <voice>1</voice>
  <type>16th</type>
  <stem>up</stem>
  <beam number="1">end</beam>
  <beam number="2">end</beam>
</note>
""")

Note(xml_note)
MusicXML.printmusicxml — Function
printmusicxml(x)
printmusicxml(io, x)

Print musicxml score

Examples

printmusicxml(score)
MusicXML.readmusicxml — Method
readmusicxml(filepath)

Reads musicxml file and then extracts the data, builds all the types and stores them in proper format.

Examples

data = readmusicxml(joinpath("examples", "musescore.musicxml"))
MusicXML.readmusicxml_partial — Method

Similar to readmusicxml but without converting it to a Julia type. Use the appropriate type to convert it

Examples

xml_note = readmusicxml_partial(path_to_file)
Note(xml_note)
MusicXML.writemusicxml — Function
writemusicxml(filename::AbstractString, x)

Writes musicxml score into a file.

Examples

writemusicxml("myscore.musicxml", score)