]> git.donarmstrong.com Git - lilypond.git/commitdiff
don't crash on unknown musicxml drums.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 9 Jan 2007 13:36:03 +0000 (14:36 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 9 Jan 2007 13:36:03 +0000 (14:36 +0100)
scripts/musicxml2ly.py

index 431a43631cdb3a6680a214f27e539b08a49895a3..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")