From: Reinhold Kainhofer Date: Thu, 20 Nov 2008 23:52:16 +0000 (+0100) Subject: MusicXML: Fix problem with tuplets without a number attribute X-Git-Tag: release/2.11.65-1~29 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=dccaf07c770465e7e98a4cd20ee078bab4f008b1;p=lilypond.git MusicXML: Fix problem with tuplets without a number attribute Also add regtest for this case --- diff --git a/input/regression/musicxml/12b-Tuplets-Finale.xml b/input/regression/musicxml/12b-Tuplets-Finale.xml index 14d586a62e..a5f620466f 100644 --- a/input/regression/musicxml/12b-Tuplets-Finale.xml +++ b/input/regression/musicxml/12b-Tuplets-Finale.xml @@ -6,7 +6,8 @@ Some tuplets (3:2, 3:2, 3:2, 4:2, 4:1, 7:3, 6:2) with the default tuplet bracket displaying the number - of actual notes played. + of actual notes played. The second tuplet does not have a number + attribute set. @@ -102,7 +103,7 @@ up - + @@ -133,7 +134,7 @@ up - + diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index e2a54008e3..48ad092feb 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -611,7 +611,9 @@ def group_tuplets (music_list, events): if music_list[j] == ev_chord: break j += 1 - nr = tuplet_elt.number + nr = 0 + if hasattr (tuplet_elt, 'number'): + nr = getattr (tuplet_elt, 'number') if tuplet_elt.type == 'start': tuplet_info = [j, None, fraction] indices.append (tuplet_info)