]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/musicxml2ly.py
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / scripts / musicxml2ly.py
index e835d68753e86a47d15da433b7a3bc0a0f359582..2a48cd12c13f2cc752620ad31da23853e9ca68a9 100644 (file)
@@ -308,7 +308,10 @@ def staff_attributes_to_lily_staff (mxl_attr):
 
 
 def extract_score_structure (part_list, staffinfo):
+    score = musicexp.Score ()
     structure = musicexp.StaffGroup (None)
+    score.set_contents (structure)
+    
     if not part_list:
         return structure
 
@@ -436,7 +439,7 @@ def extract_score_structure (part_list, staffinfo):
         return staves[0]
     for i in staves:
         structure.append_staff (i)
-    return structure
+    return score
 
 
 def musicxml_duration_to_lily (mxl_note):
@@ -1053,7 +1056,7 @@ def musicxml_words_to_lily_event (words):
             "medium": '',
             "large": '\\large',
             "x-large": '\\huge',
-            "xx-large": '\\bigger\\huge'
+            "xx-large": '\\larger\\huge'
         }.get (size, '')
         if font_size:
             event.markup += font_size
@@ -1620,7 +1623,8 @@ class LilyPondVoiceBuilder:
         diff = moment - current_end
         
         if diff < Rational (0):
-            error_message (_ ('Negative skip %s') % diff)
+            error_message (_ ('Negative skip %s (from position %s to %s)') % 
+                             (diff, current_end, moment))
             diff = Rational (0)
 
         if diff > Rational (0) and not (self.ignore_skips and moment == 0):
@@ -2423,14 +2427,14 @@ def convert (filename, options):
     parts = tree.get_typed_children (musicxml.Part)
     (voices, staff_info) = get_all_voices (parts)
 
-    score_structure = None
+    score = None
     mxl_pl = tree.get_maybe_exist_typed_child (musicxml.Part_list)
     if mxl_pl:
-        score_structure = extract_score_structure (mxl_pl, staff_info)
+        score = extract_score_structure (mxl_pl, staff_info)
         part_list = mxl_pl.get_named_children ("score-part")
 
     # score information is contained in the <work>, <identification> or <movement-title> tags
-    update_score_setup (score_structure, part_list, voices)
+    update_score_setup (score, part_list, voices)
     # After the conversion, update the list of settings for the \layout block
     update_layout_information ()
 
@@ -2467,7 +2471,7 @@ def convert (filename, options):
     printer.newline ()
     printer.dump ("% The score definition")
     printer.newline ()
-    score_structure.print_ly (printer)
+    score.print_ly (printer)
     printer.newline ()
 
     return voices