Skip to content

Commit 71969f9

Browse files
committed
CreateMusicXML.add_lyric(): if lyric nr is string assign it to name
1 parent c763311 commit 71969f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ly/musicxml/create_musicxml.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,13 @@ def add_sound_dir(self, midi_tempo):
618618

619619
def add_lyric(self, txt, syll, nr, ext=False):
620620
""" Add lyric element. """
621-
lyricnode = etree.SubElement(self.current_note, "lyric", number=str(nr))
621+
lyricnode = etree.SubElement(self.current_note, "lyric")
622+
623+
if isinstance(nr, int) or nr.isnumeric():
624+
lyricnode.attrib['number'] = str(nr)
625+
else:
626+
lyricnode.attrib['name'] = str(nr)
627+
622628
syllnode = etree.SubElement(lyricnode, "syllabic")
623629
syllnode.text = syll
624630
txtnode = etree.SubElement(lyricnode, "text")

0 commit comments

Comments
 (0)