<measure>
The <measure> element contains the notes and rests in a single measure (ห้อง).
Parent
Section titled “Parent”Attributes
Section titled “Attributes”| Attribute | Required | Type | Description |
|---|---|---|---|
number |
Yes | integer | 1-based measure number within the containing <line>. |
id |
No | token | Optional identifier, unique among all <measure> elements in the document. Exists for a foreign-namespace extension to reference; ThaiMusicXML itself does not use it. |
Children
Section titled “Children”In a pitched or unpitched part, a sequence of <note>, <rest>, and <group> elements, optionally interspersed with <bow>, <parenthesis>, and <link> markers.
In a lyric part, a sequence of <syllable> and <rest> elements, and nothing else. See <part>.
A measure is divided into beats. Each <note>, <rest>, and <group> occupies exactly one beat. A <group> splits its single beat among its own children instead of adding beats to the measure, so a measure’s beat count is the number of its <note>, <rest>, and <group> children.
<bow>, <parenthesis>, and <link> are zero-duration markers. They occupy no beat and do not affect the count.
How many beats a measure has depends on the piece. Four is the common pattern.
The measure itself is the unit of time. A measure lasts as long as any other measure in the score, and its beats divide that span among themselves, so a measure of five beats is not longer than one of four - it is the same span cut finer. See <bpm>.
A beat arrives on its last slot, so a measure is read as travelling toward its final note rather than starting from its first, and that final note lands on the measure’s closing boundary. This governs where a <group>’s children fall and where every symbol sits in the cell.
Every part plays the same measure over the same span of time, so corresponding measures must agree on beat count across parts. What each part does within those beats is free: one instrument may play four notes where another plays a note, two rests, and a <group> of three.
A lyric part is outside this. Its measures hold as many items as the words need, so they have no beat count to agree on, and the item count is instead what decides how the syllables sit in the cell. See <syllable>.
Numbering
Section titled “Numbering”Measure numbers are local to the containing <line>. They start at 1 for each line and increase by one for each measure.
Example
Section titled “Example”<measure number="1"> <note pitch="ด"/><note pitch="ร"/><note pitch="ม"/><note pitch="ร"/></measure>Conformance
Section titled “Conformance”numbermust match the measure’s position in its<line>, counting from1. Measures must appear in ascending order.- Corresponding measures across all parts referencing the same section must have the same beat count. Lyric parts are excluded from this. See
<section-ref>. - A measure’s children must match its part’s
type:<note>,<rest>, and<group>in a pitched or unpitched part,<syllable>and<rest>in a lyric part. - A measure in a pitched or unpitched part must hold at least one
<note>,<rest>, or<group>. An empty one would be a measure of no beats, and the agreement above would force every other part’s corresponding measure to no beats with it. A lyric measure may be empty, meaning nothing is sung there. id, when present, must be unique among all<measure>elements in the document.