From: Reinhold Kainhofer Date: Fri, 21 Sep 2007 22:37:48 +0000 (+0200) Subject: MusicXML: Fix problem with dynamics inserted too late X-Git-Tag: release/2.11.35-1~102 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5476414f39fe65e576ba615a542740c68408bf8d;p=lilypond.git MusicXML: Fix problem with dynamics inserted too late Insert dynamics right into the EventChord, not after it. This fixes several errors with my test files (the Recordare MusicXML samples). Signed-off-by: Reinhold Kainhofer --- diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index 9502e16bc6..857333ca20 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -549,9 +549,9 @@ class LilyPondVoiceBuilder: self.set_duration (duration) # Insert all pending dynamics right after the note/rest: - if duration > Rational (0): + if isinstance (music, musicexp.EventChord) and self.pending_dynamics: for d in self.pending_dynamics: - self.elements.append (d) + music.append (d) self.pending_dynamics = [] # Insert some music command that does not affect the position in the measure @@ -619,6 +619,9 @@ def musicxml_voice_to_lily_voice (voice): modes_found = {} lyrics = {} + # TODO: Make sure that the keys in the dict don't get reordered, since + # we need the correct ordering of the lyrics stanzas! By default, + # a dict will reorder its keys for k in voice.get_lyrics_numbers (): lyrics[k] = []