X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fmidi2ly.py;h=3a434193b083130344aa0c2f321600b0e79a000b;hb=7f40e36746b6e2afe5c47e59ee0f49808a5a1800;hp=1ab0233b79afe4e6cbd0d2fbd7071e539063a034;hpb=e76c6cb9fae87c362133987bcf5129eef0cb1123;p=lilypond.git diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index 1ab0233b79..3a434193b0 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -4,7 +4,7 @@ # This file is part of LilyPond, the GNU music typesetter. # -# Copyright (C) 1998--2011 Han-Wen Nienhuys +# Copyright (C) 1998--2012 Han-Wen Nienhuys # Jan Nieuwenhuizen # # LilyPond is free software: you can redistribute it and/or modify @@ -78,7 +78,7 @@ def warranty (): %s %s -''' % ( _ ('Copyright (c) %s by') % '1998--2011', +''' % ( _ ('Copyright (c) %s by') % '1998--2012', '\n '.join (authors), _ ('Distributed under terms of the GNU General Public License.'), _ ('It comes with NO WARRANTY.'))) @@ -975,7 +975,7 @@ def convert_midi (in_file, out_file): s = tag s += r''' -\version "2.13.53" +\version "2.14.0" ''' s += r''' @@ -1002,6 +1002,7 @@ def convert_midi (in_file, out_file): s += '\n\\score {\n <<\n' + control_track = False i = 0 for i, staff in enumerate (staves): track_name = get_track_name (i) @@ -1009,11 +1010,12 @@ def convert_midi (in_file, out_file): staff_name = track_name context = None if not i and not item and len (staves) > 1: - # control track - staff_name = get_track_name (1) - context = 'Staff' + control_track = track_name + continue elif (item and item.__class__ == Note): context = 'Staff' + if control_track: + s += ' \\context %(context)s=%(staff_name)s \\%(control_track)s\n' % locals () elif item and item.__class__ == Text: context = 'Lyrics' if context: