From 5476414f39fe65e576ba615a542740c68408bf8d Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sat, 22 Sep 2007 00:37:48 +0200 Subject: [PATCH] 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 --- scripts/musicxml2ly.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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] = [] -- 2.39.5