From 08982125770411da10f36f5861f30d570af07114 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Fri, 11 Apr 2008 20:55:38 +0200 Subject: [PATCH] MusicXML: Generate chord names context before staff (=> above the staff!) Signed-off-by: Reinhold Kainhofer --- python/musicexp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/musicexp.py b/python/musicexp.py index d0fc398f6b..5efff8a416 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -1524,6 +1524,12 @@ class Staff (StaffGroup): sub_staff_type = self.stafftype for [staff_id, voices] in self.part_information: + # Chord names need to come before the staff itself! + for [v, lyrics, figuredbass, chordnames] in voices: + if chordnames: + printer ('\context ChordNames = "%s" \\%s' % (chordnames, chordnames)) + + # now comes the real staff definition: if staff_id: printer ('\\context %s = "%s" << ' % (sub_staff_type, staff_id)) else: @@ -1533,8 +1539,6 @@ class Staff (StaffGroup): nr_voices = len (voices) for [v, lyrics, figuredbass, chordnames] in voices: n += 1 - if chordnames: - printer ('\context ChordNames = "%s" \\%s' % (chordnames, chordnames)) voice_count_text = '' if nr_voices > 1: voice_count_text = {1: ' \\voiceOne', 2: ' \\voiceTwo', -- 2.39.5