If a score does not use any <staff> elements, fool musicxml2ly with
a dummy value of "None". Similarly, don't use dict[staff], but dict.get
to avoid crashes in that case.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
sid = None
if staff_id:
sid = staff_id.get_text ()
+ else:
+ sid = "None"
if vid and not voices.has_key (vid):
voices[vid] = Musicxml_voice()
if vid and sid and not n.get_maybe_exist_typed_child (Grace):
if staff_id:
staff_id = staff_id.get_text ()
if staff_id:
- dir_voices = staff_to_voice_dict[staff_id]
+ dir_voices = staff_to_voice_dict.get (staff_id, voices.keys ())
else:
dir_voices = voices.keys ()
for v in dir_voices: