lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reimplement issue 4781 for musicxml2ly more literally. (issue 302050043


From: john
Subject: Reimplement issue 4781 for musicxml2ly more literally. (issue 302050043 by address@hidden)
Date: Thu, 23 Jun 2016 13:02:58 -0700

Reviewers: ,

Message:
Issue 4781 is reimplemented as requested by David Kastrup.

Description:
Reimplement issue 4781 for musicxml2ly more literally.
Reimplementation was necessary as part of the implementation of issue
4751, but some of the code changes for 4781 were omitted. This
reproduces all the 4781 changes.

Please review this at https://codereview.appspot.com/302050043/

Affected files (+8, -13 lines):
  M python/musicxml.py


Index: python/musicxml.py
diff --git a/python/musicxml.py b/python/musicxml.py
index f0b82f1333c7613bcd80f5c418c8f99afb96f35e..ae5ca80a59647dca423d6b374bf6b595b53ee315 100644
--- a/python/musicxml.py
+++ b/python/musicxml.py
@@ -145,11 +145,11 @@ class Music_xml_spanner(Music_xml_node):
 class Measure_element(Music_xml_node):

     def get_voice_id(self):
-        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()
         else:
-            return None
+            return self.voice_id

     def is_first(self):
# Look at all measure elements(previously we had self.__class__, which
@@ -1558,15 +1558,10 @@ class Part(Music_xml_node):
                 continue

             if isinstance(n, Direction):
-                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)
                 else:
-                    dir_voices = voices.keys()
-                for v in dir_voices:
-                    voices[v].add_element(n)
+                    assign_to_next_note.append (n)
                 continue

             if isinstance(n, Harmony) or isinstance(n, FiguredBass):
@@ -1635,7 +1630,7 @@ class Dashes(Music_xml_spanner):
 class DirType(Music_xml_node):
     pass

-class Direction(Music_xml_node):
+class Direction(Measure_element):
     pass

 class Dot(Music_xml_node):





reply via email to

[Prev in Thread] Current Thread [Next in Thread]