]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Generate chord names context before staff (=> above the staff!)
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 11 Apr 2008 18:55:38 +0000 (20:55 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 12 Apr 2008 20:15:08 +0000 (22:15 +0200)
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
python/musicexp.py

index d0fc398f6bc838c5b36da52c260ba6c73058c3e4..5efff8a4162caef574f2a4f388de8c10798a9a5a 100644 (file)
@@ -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',