From dccaf07c770465e7e98a4cd20ee078bab4f008b1 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Fri, 21 Nov 2008 00:52:16 +0100 Subject: [PATCH] MusicXML: Fix problem with tuplets without a number attribute Also add regtest for this case --- input/regression/musicxml/12b-Tuplets-Finale.xml | 7 ++++--- scripts/musicxml2ly.py | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) 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) -- 2.39.5