From: Reinhold Kainhofer Date: Tue, 11 Nov 2008 23:17:21 +0000 (+0100) Subject: MusicXML: handle harmony and direction after inserting bar checks X-Git-Tag: release/2.11.64-1~44 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0c99b8f3145a8e6bd954c92d42b29f2aeb60ce46;p=lilypond.git 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. --- 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)