From 071a1aed4d8d170d5dcc8927d1171ca77442cad9 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sun, 16 Nov 2008 00:43:06 +0100 Subject: [PATCH] MusicXML: Use "None" voice only for notes w/o voice, not for directions or attrs --- python/musicxml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/musicxml.py b/python/musicxml.py index 3c9d8a0111..e9df0b3010 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -702,9 +702,11 @@ class Part (Music_xml_node): voice_to_staff_dict = {} for n in elements: voice_id = n.get_maybe_exist_named_child (u'voice') - vid = "None" + vid = None if voice_id: vid = voice_id.get_text () + elif isinstance (n, Note): + vid = "None" staff_id = n.get_maybe_exist_named_child (u'staff') sid = None -- 2.39.2