|
From: | Jacques Menu |
Subject: | Re: musicXML: 2 staves, piano |
Date: | Sat, 25 Sep 2021 00:09:44 +0200 |
Hello folks, Sorry for this rather long answer. The problem with hello1.xml is that the <staff /> elements are misplaced. Fixing that as shown at the bottom of this message solves the issue. MuseScore does a good job at checking that MusicXML data complies to the DTD, that has the following specification for the note element: <!ELEMENT note (((grace, ((%full-note;, (tie, tie?)?) | (cue, %full-note;))) | (cue, %full-note;, duration) | (%full-note;, duration, (tie, tie?)?)), instrument?, %editorial-voice;, type?, dot*, accidental?, time-modification?, stem?, notehead?, notehead-text?, staff?, beam*, notations*, lyric*, play?)> MuseScore's message it issues is not perfect though: Opening the file anyway by choosing ‘Yes’ leads to the expected score: A systematical, thorough check of MusicXML files can be done at https://validator.w3.org . xml2ly does not check full DTD compliance, it does so only for its own safety, i.e. to avoid crashes. It succeeds with the orignal hello1.xml without any error message: jacquesmenu@macmini: ~/Desktop > xml2ly hello1.xml -auto-output-file-name jacquesmenu@macmini: ~/Desktop > cat hello1.ly \version "2.22.0" % Pick your choice from the next two lines as needed %myBreak = { \break } myBreak = {} % Pick your choice from the next two lines as needed %myPageBreak = { \break } myPageBreak = {} \header { title = "" } \paper { } \layout { \context { \Score autoBeaming = ##f % to display tuplets brackets } \context { \Voice } } Part_POne_Staff_One_Voice_One = \absolute { \language "nederlands" \key g \major \numericTimeSignature \time 2/4 \clef "treble" c'2 | % 1 \barNumberCheck #2 | % 1 \barNumberCheck #2 } Part_POne_Staff_Two_Voice_One = \absolute { \language "nederlands" \key g \major \numericTimeSignature \time 2/4 \clef "bass" d2 | % 2 \barNumberCheck #2 | % 2 \barNumberCheck #2 } \book { \score { << \new PianoStaff \with { instrumentName = "Music" } << \new Staff = "Part_POne_Staff_One" \with { } << \context Voice = "Part_POne_Staff_One_Voice_One" << \Part_POne_Staff_One_Voice_One >> >> \new Staff = "Part_POne_Staff_Two" \with { } << \context Voice = "Part_POne_Staff_Two_Voice_One" << \Part_POne_Staff_Two_Voice_One >> >> >> >> \layout { \context { \Score autoBeaming = ##f % to display tuplets brackets } \context { \Voice } } \midi { \tempo 16 = 360 } } } Dmitry, how do you generate MusicXML data? JM — <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 4.0 Partwise//EN" <score-partwise version="4.0"> <part-list> <score-part id="P1"> <part-name>Music</part-name> <score-instrument id="Piano"> <instrument-name>Piano</instrument-name> </score-instrument> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>1</divisions> <key> <fifths>1</fifths> </key> <time> <beats>2</beats> <beat-type>4</beat-type> </time> <staves>2</staves> <clef number="1"> <sign>G</sign> <line>2</line> </clef> <clef number="2"> <sign>F</sign> <line>4</line> </clef> </attributes> <note> <pitch> <step>C</step> <alter>0</alter> <octave>4</octave> </pitch> <duration>2</duration> <type>half</type> <staff>1</staff> </note> <backup> <duration>2</duration> </backup> <note> <pitch> <step>D</step> <alter>0</alter> <octave>3</octave> </pitch> <duration>2</duration> <type>half</type> <staff>2</staff> </note> </measure> </part> </score-partwise>
|
[Prev in Thread] | Current Thread | [Next in Thread] |