]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/musicxml2ly.py
Tutorial update seven; reorg tutorial into sections.
[lilypond.git] / scripts / musicxml2ly.py
index 66774fa672ed0361ad85a6ada01e33975f8e7c56..665cc1d02fcab5623e45e14784d77f44c4fad17b 100644 (file)
@@ -208,8 +208,11 @@ def musicxml_note_to_lily_main_event (n):
         event = musicexp.RestEvent()
     elif n.instrument_name:
         event = musicexp.NoteEvent ()
-        event.drum_type = instrument_drumtype_dict[n.instrument_name]
-        
+        try:
+            event.drum_type = instrument_drumtype_dict[n.instrument_name]
+        except KeyError:
+            n.message ("drum %s type unknow, please add to instrument_drumtype_dict" % n.instrument_name)
+            event.drum_type = 'acousticsnare'
     
     if not event:
         n.message ("cannot find suitable event")
@@ -264,7 +267,8 @@ class LilyPondVoiceBuilder:
         diff = moment - current_end
         
         if diff < Rational (0):
-            raise NegativeSkip(current_end, moment)
+            print 'Negative skip', diff
+            diff = Rational (0)
 
         if diff > Rational (0):
             skip = musicexp.SkipEvent()