From 27e6a49c19f84705f0ede7c186f58362688c7fd3 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 14 Mar 2011 15:44:29 +0100 Subject: [PATCH] Midi2ly: do not set instrument in lyrics track. Fixes crash. --- scripts/midi2ly.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index a4ed761448..82cfa963de 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -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 -- 2.39.5