Lyrics and chords
This page adds a vocal part, and then a row of chord symbols. Both are written as a <part>, the same way an instrument is, with type="lyric" or type="chord" saying what the measures hold.

A lyric part
Section titled “A lyric part”A lyric part is an ordinary part that takes its own row in the score. Setting type="lyric" tells the renderer to expect syllables rather than notes:
<part id="P2" type="lyric"> <instrument-name>เนื้อร้อง</instrument-name></part>The <part-data> follows the same structure as any other part: <section-ref>, <line>, <measure>. The difference is what goes inside the measures.
Syllables
Section titled “Syllables”<syllable> holds one word or syllable of Thai text. Thai is sung a syllable at a time, so each syllable gets its own element:
<measure number="4"> <rest/><syllable>ละ -</syllable><rest/><syllable>หนอ</syllable></measure>A hyphen at the end of a syllable (ละ -) indicates the word continues into the next syllable. The hyphen is part of the text content, not a special syntax.
Rests in lyric measures
Section titled “Rests in lyric measures”A <rest> in a lyric measure means nothing is sung on that beat. The reading is the same as an instrumental rest: no attack. In vocal music this is called เอื้อน, a melodic ornament where the singer holds the previous note or pauses.
The counting rule
Section titled “The counting rule”A lyric measure’s items (syllables and rests) distribute across the measure in one of two ways:
Match the beat count. If the measure has four beats and four items, each item takes one beat:
<measure number="1"> <rest/><syllable>ดวง</syllable><rest/><syllable>เดือน</syllable></measure>Four items, four beats. ดวง falls on beat 2, เดือน on beat 4.
Fewer items than beats. If the measure has four beats but only two items, the items centre in the cell:
<measure number="3"> <syllable>หอม</syllable><syllable>กลิ่น</syllable></measure>Two items in a four-beat measure. They centre, sitting roughly on beats 2 and 3. Both are ordinary ways to write a vocal line; the choice is the arranger’s.
Chords
Section titled “Chords”A chord part is the other kind of part that holds text rather than music. Declare it the same way:
<part id="P3" type="chord"> <instrument-name>คอร์ด</instrument-name></part>Inside a measure, <chord> holds one symbol, written exactly as it should print. Nothing parses it, so Am, G7, and C/E are all just text:
<measure number="1"> <chord>Am</chord></measure>That measure has one symbol where the music underneath has four beats, and chord symbols flush right: the symbol lands on beat 4. Two symbols would land on beats 3 and 4, and so on backwards from the end of the measure.
To put a chord anywhere else, pad the measure out with <rest>. A rest in a chord row holds a beat and prints nothing:
<measure number="2"> <rest/><chord>Am</chord><rest/><chord>G</chord></measure>Four items, four beats: Am on beat 2 and G on beat 4.
A measure you write nothing in means no change, and the chord already sounding carries on through it. That is why a chord part usually has far fewer items than a lyric part does.
The one hard limit is the ceiling. A chord measure may hold no more items than the measure has beats, because every item claims one.
Example file
Section titled “Example file”This tutorial file has a ระนาดเอก part and a lyric part for ท่อน 1, line 1. The lyrics enter in measure 3 with “โอ้”, then “ละ - หนอ” in measure 4, with rests where the singer pauses. It has no chord part; the chord markup above stands on its own.
<?xml version="1.0" encoding="UTF-8"?><thai-score xmlns="https://thaimusicxml.anan.ovh/ns/1" version="1.0"> <header> <title>ลาวดวงเดือน</title> <composer><text align="right">ทำนอง: พระเจ้าบรมวงศ์เธอ กรมหมื่นพิไชยมหินทโรดม</text></composer> </header> <structure> <direction> <nathap value="ลาว" /> <chan value="2" /> <bpm>60</bpm> </direction> <section id="s1" name="ท่อน 1" /> </structure> <ensemble> <part id="P1"> <instrument-name>ระนาดเอก</instrument-name> <instrument-short-name>รน.เอก</instrument-short-name> </part> <part id="P2" type="lyric"> <instrument-name>เนื้อร้อง</instrument-name> </part> </ensemble> <part-data part="P1"> <section-ref section="s1"> <line number="1"> <measure number="1"><rest/><rest/><rest/><rest/></measure> <measure number="2"><rest/><rest/><rest/><rest/></measure> <measure number="3"><rest/><note pitch="ด"/><note pitch="ร"/><note pitch="ม"/></measure> <measure number="4"><rest/><note pitch="ซ"/><rest/><note pitch="ด"/></measure> <measure number="5"><rest/><rest/><rest/><note pitch="ร"/></measure> <measure number="6"><note pitch="ด"/><note pitch="ด"/><note pitch="ด"/><note pitch="ด"/></measure> <measure number="7"><note pitch="ซ"/><note pitch="ล"/><note pitch="ด"/><note pitch="ล"/></measure> <measure number="8"><note pitch="ซ"/><note pitch="ม"/><rest/><note pitch="ซ"/></measure> </line> </section-ref> </part-data> <part-data part="P2"> <section-ref section="s1"> <line number="1"> <measure number="1"><rest/><rest/><rest/><rest/></measure> <measure number="2"><rest/><rest/><rest/><rest/></measure> <measure number="3"><rest/><rest/><rest/><syllable>โอ้</syllable></measure> <measure number="4"><rest/><syllable>ละ -</syllable><rest/><syllable>หนอ</syllable></measure> <measure number="5"><rest/><rest/><rest/><rest/></measure> <measure number="6"><rest/><rest/><rest/><rest/></measure> <measure number="7"><rest/><syllable>ดวง</syllable><rest/><syllable>เดือน</syllable></measure> <measure number="8"><rest/><rest/><rest/><syllable>เอย</syllable></measure> </line> </section-ref> </part-data></thai-score>Next, see Marking the score for bow spans, cued passages, annotations, and metadata.