I/O functions

readmusicxml, parsemusicxml, writemusicxml, printmusicxml, pprint, fwritemusicxml, readmusicxml_partial, parsemusicxml_partial
MusicXML.extractdataMethod
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.parsemusicxmlMethod
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_partialMethod

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.printmusicxmlFunction
printmusicxml(x)
printmusicxml(io, x)

Print musicxml score

Examples

printmusicxml(score)
MusicXML.readmusicxmlMethod
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_partialMethod

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.writemusicxmlFunction
writemusicxml(filename::AbstractString, x)

Writes musicxml score into a file.

Examples

writemusicxml("myscore.musicxml", score)