]> git.donarmstrong.com Git - lilypond.git/commitdiff
Midi2ly: use SEQUENCE_TRACK_NAME to set Staff.instrumentName.
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 1 Mar 2011 12:56:51 +0000 (13:56 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 1 Mar 2011 13:14:47 +0000 (14:14 +0100)
scripts/midi2ly.py

index a32d2aabc3fd672b2f7f381247a7cc0d1ecf0b53..af47460a96471092e5d83024374e565976806163 100644 (file)
@@ -405,6 +405,10 @@ class Text:
                 or d.compare (reference_note.duration)):
                 s = s + Duration (self.clocks).dump ()
             s = s + ' '
+        elif self.text and self.type == midi.SEQUENCE_TRACK_NAME:
+            text = self.text.replace ('(MIDI)', '').strip ()
+            if text:
+                s = '\n  \\set Staff.instrumentName = "%(text)s"\n  ' % locals ()
         else:
             s = '\n  % [' + self.text_types[self.type] + '] ' + self.text + '\n  '
         return s