]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Fix problem with tuplets without a number attribute
authorReinhold Kainhofer <reinhold@kainhofer.com>
Thu, 20 Nov 2008 23:52:16 +0000 (00:52 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Thu, 20 Nov 2008 23:52:16 +0000 (00:52 +0100)
Also add regtest for this case

input/regression/musicxml/12b-Tuplets-Finale.xml
scripts/musicxml2ly.py

index 14d586a62e8c68bfd32a88ef0f3eb0dd58e87ed7..a5f620466fda0723cdb5d07f771d1f57f6151b6e 100644 (file)
@@ -6,7 +6,8 @@
     <miscellaneous>
       <miscellaneous-field name="description">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.</miscellaneous-field>
+          of actual notes played. The second tuplet does not have a number 
+          attribute set.</miscellaneous-field>
     </miscellaneous>
   </identification>
   <part-list>
         </time-modification>
         <stem>up</stem>
         <notations>
-          <tuplet number="1" placement="above" type="start"/>
+          <tuplet placement="above" type="start"/>
         </notations>
       </note>
       <note>
         </time-modification>
         <stem>up</stem>
         <notations>
-          <tuplet number="1" type="stop"/>
+          <tuplet type="stop"/>
         </notations>
       </note>
       <note>
index e2a54008e321eef92b447d57d51f77a525eb710b..48ad092feb3e6bc358e509365b3cdb6f0dfb4387 100644 (file)
@@ -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)