+def conv (str):
+ if re.search ("dash-length",str):
+ sys.stderr.write ("""dash-length has been removed. Use dash-fraction instead.""")
+ raise FatalConversionError()
+ return str
+
+conversions.append (((1,9,8), conv, """dash-length -> dash-fraction"""))
+
+
+def conv (str):
+ def func(match):
+ return "#'font-size = #%d" % (2*string.atoi (match.group (1)))
+
+ str =re.sub (r"#'font-relative-size\s*=\s*#([0-9-]+)", func, str)
+ str =re.sub (r"#'font-family\s*=\s*#'ancient",
+ r"#'font-family = #'music", str)
+
+ return str
+
+conversions.append (((2,1,1), conv, """font-relative-size -> font-size"""))
+
+def conv (str):
+ str =re.sub (r"ly:get-music-length", "ly:music-length", str)
+ return str
+
+conversions.append (((2,1,2), conv, """ly:get-music-length -> ly:music-length"""))
+
+def conv (str):
+ str =re.sub (r"\.\s+stz=", ". instr ", str)
+ return str
+
+conversions.append (((2,1,3), conv, """stanza -> instrument"""))
+
+def conv (str):
+ def func (match):
+ c = match.group (1)
+ b = match.group (2)
+
+ if b == 't':
+ if c == 'Score':
+ return ''
+ else:
+ return r" \property %s.melismaBusyProperties \unset" % c
+ elif b == 'f':
+ return r"\property %s.melismaBusyProperties = #'(melismaBusy)" % c
+
+ str =re.sub (r"\\property ([a-zA-Z]+)\s*\.\s*automaticMelismata\s*=\s*##([ft])", func, str)
+ return str
+
+conversions.append (((2,1,4), conv, """removal of automaticMelismata; use melismaBusyProperties instead."""))
+
+
+
+def conv (str):
+ str =re.sub (r"\\translator\s+([a-zA-Z]+)", r"\\change \1", str)
+ return str
+
+conversions.append (((2,1,7), conv, """\\translator Staff -> \\change Staff"""))
+
+def conv (str):
+ str =re.sub (r"\\newaddlyrics", r"\\lyricsto", str)
+ return str
+
+conversions.append (((2,1,10), conv, """\\newaddlyrics -> \\lyricsto"""))
+
+def conv (str):
+ str = re.sub (r'\\include\s*"paper([0-9]+)(-init)?.ly"',
+ r"#(set-staff-size \1)", str)
+
+ def sub_note (match):
+ dur = ''
+ log = string.atoi (match.group (1))
+ dots = string.atoi (match.group (2))
+
+ if log >= 0:
+ dur = '%d' % (1 << log)
+ else:
+ dur = { -1 : 'breve',
+ -2 : 'longa',
+ -3 : 'maxima'}[log]
+
+ dur += ('.' * dots)
+
+ return r'\note #"%s" #%s' % (dur, match.group (3))
+
+ str = re.sub (r'\\note\s+#([0-9-]+)\s+#([0-9]+)\s+#([0-9.-]+)',
+ sub_note, str)
+ return str
+
+conversions.append (((2,1,11), conv, """\\include "paper16.ly" -> #(set-staff-size 16)
+\note #3 #1 #1 -> \note #"8." #1
+"""))
+