X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fmidi2ly.py;h=a5bb08a11482dd5cc139c5eac356f081e327832f;hb=63747166be3e0d4ce2499a1e1948fc4fee7fd12d;hp=18f5f1260ba8c970f5adf73f9c2b4f9a8f013bfd;hpb=7e72a1e50e94a7f9738d62599de79fe7745f600c;p=lilypond.git diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index 18f5f1260b..a5bb08a114 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -80,7 +80,7 @@ except: def _ (s): return s -program_name = 'midi2ly' +program_name = sys.argv[0] program_version = '@TOPLEVEL_VERSION@' errorport = sys.stderr @@ -133,14 +133,13 @@ def identify (): def warranty (): identify () sys.stdout.write ('\n') - sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2003')) + sys.stdout.write (_ ('Copyright (c) %s by') % ' 2001--2004') sys.stdout.write ('\n') sys.stdout.write (' Han-Wen Nienhuys') sys.stdout.write (' Jan Nieuwenhuizen') - sys.stdout.write ('\n') - sys.stdout.write (_ (r''' -Distributed under terms of the GNU General Public License. It comes with -NO WARRANTY.''')) + sys.stdout.write ('\n\n') + sys.stdout.write (_ ("Distributed under terms of the GNU General Public License.")) + sys.stdout.write (_ ("It comes with NO WARRANTY.")) sys.stdout.write ('\n') def progress (s): @@ -892,16 +891,15 @@ def dump_track (channels, n): if item and item.__class__ == Note: skip = 's' - s = s + '%s = \\notes' % (track + channel) + s = s + '%s = ' % (track + channel) if not absolute_p: s = s + '\\relative c ' elif item and item.__class__ == Text: skip = '" "' - s = s + '%s = \\lyrics ' % (track + channel) + s = s + '%s = \\lyricmode ' % (track + channel) else: skip = '\\skip ' - # must be in \notes mode for parsing \skip - s = s + '%s = \\notes ' % (track + channel) + s = s + '%s = ' % (track + channel) s = s + '{\n' s = s + ' ' + dump_channel (channels[i][0], skip) s = s + '}\n\n' @@ -984,8 +982,9 @@ def convert_midi (f, o): tag = '%% Lily was here -- automatically converted by %s from %s' % ( program_name, f) + s = '' - s = tag + '\n\n' + s = tag + '\n\\version "2.3.25"\n\n' for i in range (len (tracks)): s = s + dump_track (tracks[i], i) @@ -1085,7 +1084,6 @@ if not files or files[0] == '-': for f in files: - g = f g = strip_extension (g, '.midi') g = strip_extension (g, '.mid')