]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Fix problems with chord detection and pickup measures
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 27 Oct 2007 15:53:31 +0000 (17:53 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 27 Oct 2007 15:53:31 +0000 (17:53 +0200)
Pickup measures messed up chord detection and voice start positions
for multi-voice parts, because I erroneously reset the position after
a pickup measure to 1, while in fact it should have been the length
of the pickup measure!
Also, fix some typos and only ignore skips in pickup measures intended
for padding to a full measure. Explicitly adde skips need to be honored.

python/musicxml.py
scripts/musicxml2ly.py

index a251afa5f313427575a4a80defcac1b87b9fb7ed..cd260a404be76dbe1c863d74288f887f639d2b4f 100644 (file)
@@ -454,6 +454,7 @@ class Part (Music_xml_node):
         
     def interpret (self):
        """Set durations and starting points."""
+        """The starting point of the very first note is 0!"""
         
         part_list = self.get_part_list ()
         
@@ -467,7 +468,7 @@ class Part (Music_xml_node):
         measure_position = Rational (0)
         measure_start_moment = now
         is_first_measure = True
-        prvious_measure = None
+        previous_measure = None
        for m in measures:
             # implicit measures are used for artificial measures, e.g. when
             # a repeat bar line splits a bar into two halves. In this case,
@@ -478,7 +479,7 @@ class Part (Music_xml_node):
             # know if the next measure is implicit and continues that measure)
             if not m.is_implicit ():
                 # Warn about possibly overfull measures and reset the position
-                if attributes_object:
+                if attributes_object and previous_measure and previous_measure.partial == 0:
                     length = attributes_object.get_measure_length ()
                     new_now = measure_start_moment + length
                     if now <> new_now:
index 53d5f419c11a30d450d277cf0600db0e7c1857f2..192c3f613702b704572db6e1631b62d86275ed04 100644 (file)
@@ -898,7 +898,7 @@ class LilyPondVoiceBuilder:
             error_message ('Negative skip %s' % diff)
             diff = Rational (0)
 
-        if diff > Rational (0) and not self.ignore_skips:
+        if diff > Rational (0) and not (self.ignore_skips and moment == 0):
             skip = musicexp.SkipEvent()
             skip.duration.duration_log = 0
             skip.duration.factor = diff