]> git.donarmstrong.com Git - lilypond.git/commitdiff
Midi2ly: do not set instrument in lyrics track. Fixes crash.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 14 Mar 2011 14:44:29 +0000 (15:44 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 14 Mar 2011 14:45:09 +0000 (15:45 +0100)
scripts/midi2ly.py

index a4ed761448fdaaddbc471d259ac37f43220a1060..82cfa963de6ec40d7e4cff438e741cccd7b5b96b 100644 (file)
@@ -403,7 +403,8 @@ class Text:
             s = s + ' '
         elif (self.text.strip ()
               and self.type == midi.SEQUENCE_TRACK_NAME
-              and not self.text == 'control track'):
+              and not self.text == 'control track'
+              and not self.track.lyrics_p_):
             text = self.text.replace ('(MIDI)', '').strip ()
             if text:
                 s = '\n  \\set Staff.instrumentName = "%(text)s"\n  ' % locals ()
@@ -509,6 +510,7 @@ class Channel:
                 elif (e[1][1] >= midi.SEQUENCE_NUMBER
                       and e[1][1] <= midi.CUE_POINT):
                     text = Text (e[1][1], e[1][2])
+                    text.track = self
                     music.append ((t, text))
                     if (text.type == midi.SEQUENCE_TRACK_NAME):
                         self.name = text.text