Skip to content

Commit 3aa99ee

Browse files
committed
Add test for \lyricsto
1 parent 71969f9 commit 3aa99ee

File tree

3 files changed

+275
-0
lines changed

3 files changed

+275
-0
lines changed

tests/test_xml.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def test_dynamics():
3030
def test_tuplet():
3131
compare_output('tuplet')
3232

33+
def test_lyrics_simple_lyricsto():
34+
compare_output('lyrics_simple_lyricsto')
3335

3436
def ly_to_xml(filename):
3537
"""Read Lilypond file and return XML string."""
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
\version "2.19.55"
2+
3+
\header {
4+
title = "lyrics simple lyricsto"
5+
}
6+
7+
verse = \lyricmode {
8+
\set stanza = "1"
9+
Do -- re -- mi fa
10+
Hel -- lo __ the -- re
11+
}
12+
13+
chorus = \lyricmode {
14+
\set stanza = "chor"
15+
This is the cho -- rus, la __ di -- da
16+
}
17+
18+
\score {
19+
\new Staff {
20+
<<
21+
\new Voice = "main" {
22+
\voiceOne
23+
\clef treble
24+
\relative c' {
25+
c4 d e f |
26+
g16 a4( f8.) b4 c4 |
27+
}
28+
}
29+
\new Voice = "mainTwo" {
30+
\voiceTwo
31+
\clef treble
32+
\relative c' {
33+
c2 c | g' g |
34+
}
35+
}
36+
\new Lyrics \lyricsto "main" \verse
37+
\new Lyrics \lyricsto "main" \chorus
38+
>>
39+
}
40+
\layout { }
41+
}
42+
\voiceTwo
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN"
3+
"http://www.musicxml.org/dtds/partwise.dtd">
4+
<score-partwise version="3.0">
5+
<movement-title>lyrics simple lyricsto</movement-title>
6+
<identification>
7+
<encoding>
8+
<software>python-ly 0.9.5</software>
9+
<encoding-date>2016-03-28</encoding-date>
10+
</encoding>
11+
</identification>
12+
<part-list>
13+
<score-part id="P1">
14+
<part-name />
15+
</score-part>
16+
</part-list>
17+
<part id="P1">
18+
<measure number="1">
19+
<attributes>
20+
<divisions>4</divisions>
21+
<time symbol="common">
22+
<beats>4</beats>
23+
<beat-type>4</beat-type>
24+
</time>
25+
<clef>
26+
<sign>G</sign>
27+
<line>2</line>
28+
</clef>
29+
</attributes>
30+
<note>
31+
<pitch>
32+
<step>C</step>
33+
<octave>4</octave>
34+
</pitch>
35+
<duration>4</duration>
36+
<voice>1</voice>
37+
<type>quarter</type>
38+
<lyric number="1">
39+
<syllabic>begin</syllabic>
40+
<text>Do</text>
41+
</lyric>
42+
<lyric name="chor">
43+
<syllabic>single</syllabic>
44+
<text>This</text>
45+
</lyric>
46+
</note>
47+
<note>
48+
<pitch>
49+
<step>D</step>
50+
<octave>4</octave>
51+
</pitch>
52+
<duration>4</duration>
53+
<voice>1</voice>
54+
<type>quarter</type>
55+
<lyric number="1">
56+
<syllabic>middle</syllabic>
57+
<text>re</text>
58+
</lyric>
59+
<lyric name="chor">
60+
<syllabic>single</syllabic>
61+
<text>is</text>
62+
</lyric>
63+
</note>
64+
<note>
65+
<pitch>
66+
<step>E</step>
67+
<octave>4</octave>
68+
</pitch>
69+
<duration>4</duration>
70+
<voice>1</voice>
71+
<type>quarter</type>
72+
<lyric number="1">
73+
<syllabic>end</syllabic>
74+
<text>mi</text>
75+
</lyric>
76+
<lyric name="chor">
77+
<syllabic>single</syllabic>
78+
<text>the</text>
79+
</lyric>
80+
</note>
81+
<note>
82+
<pitch>
83+
<step>F</step>
84+
<octave>4</octave>
85+
</pitch>
86+
<duration>4</duration>
87+
<voice>1</voice>
88+
<type>quarter</type>
89+
<lyric number="1">
90+
<syllabic>single</syllabic>
91+
<text>fa</text>
92+
</lyric>
93+
<lyric name="chor">
94+
<syllabic>begin</syllabic>
95+
<text>cho</text>
96+
</lyric>
97+
</note>
98+
<backup>
99+
<duration>16</duration>
100+
</backup>
101+
<note>
102+
<pitch>
103+
<step>C</step>
104+
<octave>4</octave>
105+
</pitch>
106+
<duration>8</duration>
107+
<voice>2</voice>
108+
<type>half</type>
109+
</note>
110+
<note>
111+
<pitch>
112+
<step>C</step>
113+
<octave>4</octave>
114+
</pitch>
115+
<duration>8</duration>
116+
<voice>2</voice>
117+
<type>half</type>
118+
</note>
119+
</measure>
120+
<measure number="2">
121+
<note>
122+
<pitch>
123+
<step>G</step>
124+
<octave>4</octave>
125+
</pitch>
126+
<duration>1</duration>
127+
<voice>1</voice>
128+
<type>16th</type>
129+
<lyric number="1">
130+
<syllabic>begin</syllabic>
131+
<text>Hel</text>
132+
</lyric>
133+
<lyric name="chor">
134+
<syllabic>end</syllabic>
135+
<text>rus,</text>
136+
</lyric>
137+
</note>
138+
<note>
139+
<pitch>
140+
<step>A</step>
141+
<octave>4</octave>
142+
</pitch>
143+
<duration>4</duration>
144+
<voice>1</voice>
145+
<type>quarter</type>
146+
<notations>
147+
<slur number="1" type="start" />
148+
</notations>
149+
<lyric number="1">
150+
<syllabic>end</syllabic>
151+
<text>lo</text>
152+
<extend />
153+
</lyric>
154+
<lyric name="chor">
155+
<syllabic>single</syllabic>
156+
<text>la</text>
157+
<extend />
158+
</lyric>
159+
</note>
160+
<note>
161+
<pitch>
162+
<step>F</step>
163+
<octave>4</octave>
164+
</pitch>
165+
<duration>3</duration>
166+
<voice>1</voice>
167+
<type>eighth</type>
168+
<dot />
169+
<notations>
170+
<slur number="1" type="stop" />
171+
</notations>
172+
</note>
173+
<note>
174+
<pitch>
175+
<step>B</step>
176+
<octave>4</octave>
177+
</pitch>
178+
<duration>4</duration>
179+
<voice>1</voice>
180+
<type>quarter</type>
181+
<lyric number="1">
182+
<syllabic>begin</syllabic>
183+
<text>the</text>
184+
</lyric>
185+
<lyric name="chor">
186+
<syllabic>begin</syllabic>
187+
<text>di</text>
188+
</lyric>
189+
</note>
190+
<note>
191+
<pitch>
192+
<step>C</step>
193+
<octave>5</octave>
194+
</pitch>
195+
<duration>4</duration>
196+
<voice>1</voice>
197+
<type>quarter</type>
198+
<lyric number="1">
199+
<syllabic>end</syllabic>
200+
<text>re</text>
201+
</lyric>
202+
<lyric name="chor">
203+
<syllabic>end</syllabic>
204+
<text>da</text>
205+
</lyric>
206+
</note>
207+
<backup>
208+
<duration>16</duration>
209+
</backup>
210+
<note>
211+
<pitch>
212+
<step>G</step>
213+
<octave>4</octave>
214+
</pitch>
215+
<duration>8</duration>
216+
<voice>2</voice>
217+
<type>half</type>
218+
</note>
219+
<note>
220+
<pitch>
221+
<step>G</step>
222+
<octave>4</octave>
223+
</pitch>
224+
<duration>8</duration>
225+
<voice>2</voice>
226+
<type>half</type>
227+
</note>
228+
</measure>
229+
<measure number="3" />
230+
</part>
231+
</score-partwise>

0 commit comments

Comments
 (0)