[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix MusicXML reg tests that have both Lyrics and Chords (issue 316950043
From: |
pkx166h |
Subject: |
Fix MusicXML reg tests that have both Lyrics and Chords (issue 316950043 by address@hidden) |
Date: |
Sat, 03 Dec 2016 03:27:19 -0800 |
Reviewers: ,
Message:
Passes make, make check and a full make doc.
Description:
Fix MusicXML reg tests that have both Lyrics and Chords
As commented in the patch
I did not find any documentation
if a chord element can contain
multiple lyrics, so I just
assumed that the first note
of the chord contained the
Lyrics (consistant with
Finale and Muscore exports).
Please review this at https://codereview.appspot.com/316950043/
Affected files (+8, -0 lines):
M scripts/musicxml2ly.py
Index: scripts/musicxml2ly.py
diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py
old mode 100644
new mode 100755
index
766214bd762b5dc8e991849d70a91473f4bbb782..4d6b149ef18804753618ad6b7c046d24026bf755
--- a/scripts/musicxml2ly.py
+++ b/scripts/musicxml2ly.py
@@ -2127,6 +2127,9 @@ def extract_lyrics(voice, lyric_key, lyrics_dict):
def is_rest(elem):
return elem.get_typed_children(musicxml.Rest)
+ def is_chord(elem):
+ return elem.get_typed_children(musicxml.Chord)
+
def is_note_and_not_rest(elem):
return is_note(elem) and not is_rest(elem)
@@ -2153,6 +2156,11 @@ def extract_lyrics(voice, lyric_key, lyrics_dict):
not note_has_lyric_belonging_to_lyric_part:
result.append('\skip1 ')
# Note does not have any lyric attached to it.
+ elif is_chord(elem):
+ # note without lyrics part of a chord. MusicXML format is
+ # unclear if a chord element could contain a lyric, lets
+ # asume that we do not want to put a skip here.
+ continue
elif is_note_and_not_rest(elem):
result.append('\skip1 ')
- Fix MusicXML reg tests that have both Lyrics and Chords (issue 316950043 by address@hidden),
pkx166h <=