#!@PYTHON@
# info mostly taken from looking at files. See also
-# http://www.cs.uu.nl/~hanwen/lily-devel/etf.html
+# http://lilypond.org/wiki/?EnigmaTransportFormat
# This supports
#
# * dynamics
# * empty measures (eg. twopt03.etf from freenote)
#
-#
+
program_name = 'etf2ly'
version = '@TOPLEVEL_VERSION@'
(n, a) = tuple2
nn = chr ((n+ 2)%7 + ord ('a'))
- if a == -1:
- nn = nn + 'es'
- elif a == -2:
- nn = nn + 'eses'
- elif a == 1:
- nn = nn + 'is'
- elif a == 2:
- nn = nn + 'isis'
-
- return nn
+ return nn + {-2:'eses', -1:'es', 0:'', 1:'is', 2:'isis'}[a]
class Tuplet:
if not cs or not ce:
raise IndexError
- cs.note_suffix = '(' + cs.note_suffix
- ce.note_prefix = ce.note_prefix + ')'
+ cs.note_suffix = '-(' + cs.note_suffix
+ ce.note_suffix = ce.note_suffix + '-)'
+
except IndexError:
sys.stderr.write ("""\nHuh? Slur no %d between (%d,%d), with %d notes""" % (self.number, startnote, endnote, len (chords)))
def set_timesig (self, finale):
(beats, fdur) = finale
(log, dots) = EDU_to_duration (fdur)
- assert dots == 0
+ if dots <> 0:
+ sys.stderr.write ("\nHuh? Beat duration has a dot? (EDU Duration = %d)" % fdur)
self.timesig = (beats, log)
def length (self):
if rest:
nn = rest
- s = s + '%s%d%s' % (nn, self.duration[0], '.'* self.duration[1])
+ s = s + nn
if not self.pitches:
- s = 'r%d%s' % (self.duration[0] , '.'* self.duration[1])
- s = self.note_prefix + s + self.note_suffix
+ s = 'r'
if len (self.pitches) > 1:
- s = '<%s>' % s
+ s = '<< %s >>' % s
+
+ s = s + '%d%s' % (self.duration[0], '.'* self.duration[1])
+ s = self.note_prefix + s + self.note_suffix
s = self.chord_prefix + s + self.chord_suffix
+
return s
return list
def read_finale_value (str):
+ """
+Pry off one value from STR. The value may be $hex, decimal, or "string".
+Return: (value, rest-of-STR)
+ """
while str and str[0] in ' \t\n':
str = str[1:]
frame_obj_list = [None]
for frno in m.frames:
- fr = self.frames[frno]
- frame_obj_list.append (fr)
+ try:
+ fr = self.frames[frno]
+ frame_obj_list.append (fr)
+ except IndexError:
+ sys.stderr.write ("\nNon-existent frame %d" % frno)
m.frames = frame_obj_list
for fr in frame_obj_list[1:]:
Finale product. This program will convert a subset of ETF to a
ready-to-use lilypond file.
-Report bugs to bug-gnu-music@gnu.org
+Report bugs to bug-lilypond@gnu.org
Written by Han-Wen Nienhuys <hanwen@cs.uu.nl>
""")
and you are welcome to change it and/or distribute copies of it under
certain conditions. Invoke as `midi2ly --warranty' for more information.
-Copyright (c) 2000 by Han-Wen Nienhuys <hanwen@cs.uu.nl>
+Copyright (c) 2000--2003 by Han-Wen Nienhuys <hanwen@cs.uu.nl>
""" % version)