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")
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()