From 0c99b8f3145a8e6bd954c92d42b29f2aeb60ce46 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Wed, 12 Nov 2008 00:17:21 +0100 Subject: [PATCH] MusicXML: handle harmony and direction after inserting bar checks Harmony and Direction elements should come AFTER the bar check, since they already start the new measure and count as the first element. --- scripts/musicxml2ly.py | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index a2e09e87e2..a55ae8e430 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -1761,31 +1761,6 @@ def musicxml_voice_to_lily_voice (voice): if a: voice_builder.add_partial (a) continue - - if isinstance (n, musicxml.Direction): - for a in musicxml_direction_to_lily (n): - if a.wait_for_note (): - voice_builder.add_dynamics (a) - else: - voice_builder.add_command (a) - continue - - if isinstance (n, musicxml.Harmony): - for a in musicxml_harmony_to_lily (n): - if a.wait_for_note (): - voice_builder.add_dynamics (a) - else: - voice_builder.add_command (a) - for a in musicxml_harmony_to_lily_chordname (n): - pending_chordnames.append (a) - continue - - if isinstance (n, musicxml.FiguredBass): - a = musicxml_figured_bass_to_lily (n) - if a: - pending_figured_bass.append (a) - continue - is_chord = n.get_maybe_exist_named_child ('chord') if not is_chord: try: @@ -1828,6 +1803,31 @@ def musicxml_voice_to_lily_voice (voice): voice_builder.add_multibar_rest (n._duration) continue + + if isinstance (n, musicxml.Direction): + for a in musicxml_direction_to_lily (n): + if a.wait_for_note (): + voice_builder.add_dynamics (a) + else: + voice_builder.add_command (a) + continue + + if isinstance (n, musicxml.Harmony): + for a in musicxml_harmony_to_lily (n): + if a.wait_for_note (): + voice_builder.add_dynamics (a) + else: + voice_builder.add_command (a) + for a in musicxml_harmony_to_lily_chordname (n): + pending_chordnames.append (a) + continue + + if isinstance (n, musicxml.FiguredBass): + a = musicxml_figured_bass_to_lily (n) + if a: + pending_figured_bass.append (a) + continue + if isinstance (n, musicxml.Attributes): for a in musicxml_attributes_to_lily (n): voice_builder.add_command (a) -- 2.39.5