|
From: | Jacques Menu Muzhic |
Subject: | Re: Repeat question |
Date: | Thu, 28 Jun 2018 10:35:49 +0200 |
Hello David, I downloaded the LilyPond Unofficial Test Suite at the time when the links to in lilypond.org were dead (I’d say 2.5 years ago), can’t remember where that was from, probably from the GIT repository. Don’t know whether 45d-Repeats-Nested-Alternatives.xml changed between versions of LilyPond. The hookless alternative at measure 12 and the extra measure at the end I added two days ago, following Torsten’s answer. The 8 comes from: <measure number="12"> <barline location="left"> <ending number="8" type="start"/> </barline> <note> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>4</duration> <voice>1</voice> </note> <barline location="right"> <ending number="8" type="discontinue"/> </barline> </measure> The difficulty with this file is that there are nested repeats, and it’s not obvious what its semantics is. On the MuseScore output below, with bar numbers displayed: I guess the measures are to be played in this order: 1 2 1 3 4 5 1 6 7 8 9 10 back to beginning 1 2 1 3 4 5 1 6 7 8 9 11 back to beginning 1 2 1 3 4 5 1 6 7 8 9 12 13 Of course, there’s a risk of getting lost when playing such music. The MusicXML 3.0 DTD does not help regarding this semantics question. The only 3 occurences of ‘backward’ use for repeats are the following ones (in barline.mod), and the fact that repeats can be nested is not mentioned. The exact same text is in barline.mod in the 3.1 DTD: <!-- Repeat marks. The start of the repeat has a forward direction while the end of the repeat has a backward direction. Backward repeats that are not part of an ending can use the times attribute to indicate the number of times the repeated section is played. The winged attribute indicates whether the repeat has winged extensions that appear above and below the barline. The straight and curved values represent single wings, while the double-straight and double-curved values represent double wings. The none value indicates no wings and is the default. --> <!ELEMENT repeat EMPTY> <!ATTLIST repeat direction (backward | forward) #REQUIRED times CDATA #IMPLIED winged (none | straight | curved | double-straight | double-curved) #IMPLIED > So yes, MusicXML semantics is somewhat of a fuzzy target, and you have to look at what some existing tools do to tackle that, which is what I do (the good old ‘look at what the compiler does’). To be fair, it is known that describing the semantics of a computer language in a complete and consistent manner is quite difficult. Decades ago, that was done for Algol-68, which resulted in a textual formal specification a great number of pages. An anecdote: Laurent Trilling, one of the tenants of this language, told me that part of a night was spent by attendants of an Algol-68 conference trying to determine the semantics of a given code snippet, which was not clear. That took time, but the formal specification finally gave the answer! JM
|
[Prev in Thread] | Current Thread | [Next in Thread] |