+
+
+
+def conv (str):
+ str = re.sub (r'\\set\s+Score\s*\.\s*barNumberAlignSymbol\s*=',
+ r"\\override Score.BarNumber #'break-align-symbol = ", str)
+ str = re.sub (r'\\set\s*Score\s*\.\s*rehearsalMarkAlignSymbol\s*=',
+ r"\\override Score.RehearsalMark #'break-align-symbol = ", str)
+ return str
+
+conversions.append (((2, 7, 40), conv,
+ "rehearsalMarkAlignSymbol/barNumberAlignSymbol -> break-align-symbol"))
+
+
+def conv (str):
+ str = re.sub ('page-penalty', 'page-break-penalty', str)
+ str = re.sub ('([^-])penalty', '\1break-penalty', str)
+ return str
+
+conversions.append (((2, 9, 4), conv, """(page-)penalty -> (page-)break-penalty"""))
+
+def conv (str):
+ str = re.sub (r'\\context\s+\"?([a-zA-Z]+)\"?\s*\\applyOutput', r"\\applyOutput #'\1", str)
+ return str
+
+conversions.append (((2, 9, 6), conv, """\context Foo \\applyOutput #bla -> \\applyOutput #'Foo #bla """))
+
+
+def conv (str):
+ str = re.sub ('annotatepage', 'annotate-page', str)
+ str = re.sub ('annotateheaders', 'annotate-headers', str)
+ str = re.sub ('annotatesystems', 'annotate-systems', str)
+ return str
+
+conversions.append (((2, 9, 9), conv, """annotatefoo -> annotate-foo"""))
+
+
+def conv (str):
+ str = re.sub (r"""(\\set\s)?(?P<context>[a-zA-Z]*.?)tupletNumberFormatFunction\s*=\s*#denominator-tuplet-formatter""",
+ r"""\\override \g<context>TupletNumber #'text = #tuplet-number::calc-denominator-text""", str)
+
+ str = re.sub (r"""(\\set\s+)?(?P<context>[a-zA-Z]*.?)tupletNumberFormatFunction\s*=\s*#fraction-tuplet-formatter""",
+ r"""\\override \g<context>TupletNumber #'text = #tuplet-number::calc-fraction-text""", str)
+
+ if re.search ('tupletNumberFormatFunction', str):
+ error_file.write ("\n")
+ error_file.write ("tupletNumberFormatFunction has been removed. Use #'text property on TupletNumber")
+ error_file.write ("\n")
+
+ return str
+
+conversions.append (((2, 9, 11), conv, """\\set tupletNumberFormatFunction -> \\override #'text = """))
+
+
+def conv (str):
+ str = re.sub ('vocNam', 'shortVocalName', str)
+ str = re.sub (r'\.instr\s*=', r'.shortInstrumentName =', str)
+ str = re.sub (r'\.instrument\s*=', r'.instrumentName =', str)
+ return str
+
+conversions.append (((2, 9, 13), conv, """instrument -> instrumentName, instr -> shortInstrumentName, vocNam -> shortVocalName"""))
+
+
+def conv (str):
+
+ def sub_tempo (m):
+ dur = int (m.group (1))
+ dots = len (m.group (2))
+ count = int (m.group (3))
+
+ log2 = 0
+ while dur > 1 :
+ dur /= 2
+ log2 += 1
+
+ den = (1 << dots) * (1 << log2)
+ num = ((1 << (dots+1)) - 1)
+
+ return """
+ \midi {
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment %d %d)
+ }
+ }
+
+""" % (num*count, den)
+
+ str = re.sub (r'\\midi\s*{\s*\\tempo ([0-9]+)\s*([.]*)\s*=\s*([0-9]+)\s*}', sub_tempo, str)
+ return str
+
+conversions.append (((2, 9, 16), conv, """deprecate \\tempo in \\midi"""))
+
+def conv (str):
+ str = re.sub ('printfirst-page-number', 'print-first-page-number', str)
+ return str
+
+conversions.append (((2, 9, 19), conv, """printfirst-page-number -> print-first-page-number"""))
+
+
+def conv (str):
+ return str
+
+conversions.append (((2, 10, 0), conv, """bump version for release"""))
+
+
+def conv (str):
+ return re.sub ('ly:clone-parser',
+ 'ly:parser-clone', str)
+
+conversions.append (((2, 11, 2), conv, """ly:clone-parser -> ly:parser-clone"""))
+
+
+
+def conv (str):
+ str = re.sub ("Accidental\s*#'cautionary-style\s*=\s*#'smaller",
+ "AccidentalCautionary #'font-size = #-2", str)
+ str = re.sub ("Accidental\s*#'cautionary-style\s*=\s*#'parentheses",
+ "AccidentalCautionary #'parenthesized = ##t", str)
+ str = re.sub ("([A-Za-z]+)\s*#'cautionary-style\s*=\s*#'parentheses",
+ r"\1 #'parenthesized = ##t", str)
+ str = re.sub ("([A-Za-z]+)\s*#'cautionary-style\s*=\s*#'smaller",
+ r"\1 #'font-size = #-2", str)
+
+ return str
+
+conversions.append (((2, 11, 5), conv, """deprecate cautionary-style. Use AccidentalCautionary properties"""))
+
+
+
+
+def conv (str):
+
+ def sub_acc_name (m):
+ idx = int (m.group (1).replace ('M','-'))
+
+ return ["accidentals.doublesharp",
+ "accidentals.sharp.slashslash.stemstemstem",
+ "accidentals.sharp",
+ "accidentals.sharp.slashslash.stem",
+ "accidentals.natural",
+ "accidentals.mirroredflat",
+ "accidentals.flat",
+ "accidentals.mirroredflat.flat",
+ "accidentals.flatflat"][4-idx]
+
+ str = re.sub (r"accidentals[.](M?[-0-9]+)",
+ sub_acc_name, str)
+ str = re.sub (r"(KeySignature|Accidental[A-Za-z]*)\s*#'style\s*=\s*#'([a-z]+)",
+ r"\1 #'glyph-name-alist = #alteration-\2-glyph-name-alist", str)
+
+ return str
+
+conversions.append (((2, 11, 6), conv, """Rename accidental glyphs, use glyph-name-alist."""))