From: Reinhold Kainhofer Date: Sat, 27 Oct 2007 15:53:31 +0000 (+0200) Subject: MusicXML: Fix problems with chord detection and pickup measures X-Git-Tag: release/2.11.35-1~64 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=845fcdf0f1fc8614a8963dc1f17df71f339d45e0;p=lilypond.git MusicXML: Fix problems with chord detection and pickup measures 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. --- diff --git a/python/musicxml.py b/python/musicxml.py index a251afa5f3..cd260a404b 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -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: diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index 53d5f419c1..192c3f6137 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -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