previous.addDuration(note)
continue
else :
- previous.addDuration(note)
+ try :
+ previous.addDuration(note)
+ except AttributeError :
+ # can occur if part starts with a rest.
+ if previous is not None :
+ # something else is wrong.
+ raise
continue
previous = note