<structure>
The <structure> element defines the score layout: which sections are played, in what order, how often, and with what directions along the way.
Parent
Section titled “Parent”Children
Section titled “Children”A sequence of:
These can appear in any order and be repeated.
Section order
Section titled “Section order”A score’s section order is the order in which <section> and <play> elements appear, walking depth first into any <repeat> wrappers. Interleaved <annotation>, <br>, and <direction> elements do not affect it. No attribute carries the order, so reordering these elements in the document reorders the score.
<section> and <play> both put one play of a section into that order. The difference is that <section> also declares the section, so it appears exactly once, and <play> only plays one already declared, so a section that comes back later in the piece needs no second copy of its music.
Directions
Section titled “Directions”A <direction> takes effect where it appears and stays in effect until another <direction> changes the same setting. Processors read <structure> from top to bottom, and directions apply to every part.
A direction inside a <repeat> is re-read on each pass, so it applies again on every repetition.
Annotations and breaks
Section titled “Annotations and breaks”An <annotation> or <br> inside a <repeat> is printed once, where it sits in the document, and is not repeated per pass.
The two behave differently from <direction> because they are different kinds of thing. A direction governs how the music sounds, so it has to apply again every time the music comes round. An annotation is page furniture, and the page is printed once and read straight down however many times the score is played through.
Example
Section titled “Example”<structure> <annotation>Example Comments</annotation> <direction> <nathap value="ปรบไก่" /> <chan value="1" /> <bpm>65</bpm> </direction> <annotation>บรรทัดที่ 1 มี 7 ห้อง</annotation> <repeat times="2"> <section id="s1" name="ท่อน 1" /> </repeat> <annotation>End of section 1 message</annotation></structure>