145a146 > self.voice_id = None; 285,287c286,288 < voice_id = self.get_maybe_exist_named_child ('voice') < if voice_id: < return voice_id.get_text () --- > voice = self.get_maybe_exist_named_child ('voice') > if voice: > return voice.get_text () 289c290 < return None --- > return self.voice_id; 659a661,662 > voice_id = None; > assign_to_next_voice = [] 660a664,679 > # assign a voice to all measure elements > if (n.get_name() == 'backup'): > voice_id = None; > > if isinstance(n, Measure_element): > if n.get_voice_id (): > voice_id = n.get_voice_id () > for i in assign_to_next_voice: > i.voice_id = voice_id > assign_to_next_voice = [] > else: > if voice_id: > n.voice_id = voice_id > else: > assign_to_next_voice.append (n) > 865,869c884,885 < staff_id = n.get_maybe_exist_named_child (u'staff') < if staff_id: < staff_id = staff_id.get_text () < if staff_id: < dir_voices = staff_to_voice_dict.get (staff_id, voices.keys ()) --- > if (n.voice_id): > voices[n.voice_id].add_element (n) 871,873c887 < dir_voices = voices.keys () < for v in dir_voices: < voices[v].add_element (n) --- > assign_to_next_note.append (n) 1072c1086 < class Direction (Music_xml_node): --- > class Direction (Measure_element):