+
+
+
+def conv (str):
+ str = re.sub(r'\"tabloid\"', '"11x17"', str)
+ return str
+
+conversions.append (((2, 7, 11), conv,
+ '''\"tabloid\" -> \"11x17\"'''))
+
+def conv (str):
+ str = re.sub(r'outputProperty' , 'overrideProperty', str)
+ return str
+
+conversions.append (((2, 7, 12), conv,
+ '''outputProperty -> overrideProperty'''))
+
+
+def conv (str):
+ def subber (match):
+ newkey = {'spacing-procedure': 'springs-and-rods',
+ 'after-line-breaking-callback' : 'after-line-breaking',
+ 'before-line-breaking-callback' : 'before-line-breaking',
+ 'print-function' : 'stencil'} [match.group(3)]
+ what = match.group (1)
+ grob = match.group (2)
+
+ if what == 'revert':
+ return "revert %s #'callbacks %% %s\n" % (grob, newkey)
+ elif what == 'override':
+ return "override %s #'callbacks #'%s" % (grob, newkey)
+ else:
+ raise 'urg'
+ return ''
+
+ str = re.sub(r"(override|revert)\s*([a-zA-Z.]+)\s*#'(spacing-procedure|after-line-breaking-callback"
+ + r"|before-line-breaking-callback|print-function)",
+ subber, str)
+
+ if re.search ('bar-size-procedure', str):
+ stderr_write (NOT_SMART % "bar-size-procedure")
+ if re.search ('space-function', str):
+ stderr_write (NOT_SMART % "space-function")
+ if re.search ('verticalAlignmentChildCallback', str):
+ stderr_write (_ ('verticalAlignmentChildCallback has been deprecated'))
+ return str
+
+conversions.append (((2, 7, 13), conv,
+ '''layout engine refactoring [FIXME]'''))
+
+
+
+def conv (str):
+ str = re.sub (r"\\override +([A-Z.a-z]+) #'callbacks",
+ r"\\override \1", str)
+ str = re.sub (r"\\revert ([A-Z.a-z]+) #'callbacks % ([a-zA-Z]+)",
+ r"\\revert \1 #'\2", str)
+ str = re.sub (r"([XY]-extent)-callback", r'\1', str)
+ str = re.sub (r"RemoveEmptyVerticalGroup", "VerticalAxisGroup", str)
+ str = re.sub (r"\\set ([a-zA-Z]*\.?)minimumVerticalExtent",
+ r"\\override \1VerticalAxisGroup #'minimum-Y-extent",
+ str)
+ str = re.sub (r"minimumVerticalExtent",
+ r"\\override VerticalAxisGroup #'minimum-Y-extent",
+ str)
+ str = re.sub (r"\\set ([a-zA-Z]*\.?)extraVerticalExtent",
+ r"\\override \1VerticalAxisGroup #'extra-Y-extent", str)
+ str = re.sub (r"\\set ([a-zA-Z]*\.?)verticalExtent",
+ r"\\override \1VerticalAxisGroup #'Y-extent", str)
+ return str
+
+conversions.append (((2, 7, 14), conv,
+ _ ('Remove callbacks property, deprecate XY-extent-callback.')))
+
+
+def conv (str):
+ if re.search ('[XY]-offset-callbacks', str):
+ stderr_write (NOT_SMART % "[XY]-offset-callbacks")
+ if re.search ('position-callbacks', str):
+ stderr_write (NOT_SMART % "position-callbacks")
+ return str
+
+conversions.append (((2, 7, 15), conv,
+ _ ('Use grob closures iso. XY-offset-callbacks.')))
+
+
+def conv (str):
+ def sub_syms (m):
+ syms = m.group (1).split ()
+ tags = ["\\tag #'%s" % s for s in syms]
+ return ' '.join (tags)
+
+ str = re.sub (r"\\tag #'\(([^)]+)\)", sub_syms, str)
+ return str
+
+conversions.append (((2, 7, 22), conv,
+ """\tag #'(a b) -> \tag #'a \tag #'b""" ))
+
+def conv (str):
+ str = re.sub (r"#'number-visibility",
+ "#'number-visibility % number-visibility is deprecated. Tune the TupletNumber instead\n",
+ str)
+ return str
+
+conversions.append (((2, 7, 24), conv,
+ _ ('deprecate %s') % 'number-visibility'))
+
+def conv (str):
+ str = re.sub (r"ly:spanner-get-bound", "ly:spanner-bound", str)
+ return str
+
+conversions.append (((2, 7, 28), conv,
+ """ly:spanner-get-bound -> ly:spanner-bound"""))
+
+def conv (str):
+ for a in ['beamed-lengths', 'beamed-minimum-free-lengths',
+ 'lengths',
+ 'beamed-extreme-minimum-free-lengths']:
+ str = re.sub (r"\\override\s+Stem\s+#'%s" % a,
+ r"\\override Stem #'details #'%s" % a,
+ str)
+ return str
+
+conversions.append (((2, 7, 29), conv,
+ """override Stem #'beamed-* -> #'details #'beamed-*"""))
+
+def conv (str):
+ str = re.sub (r'\\epsfile *#"', r'\\epsfile #X #10 #"', str)
+ return str
+
+conversions.append (((2, 7, 30), conv,
+ """\\epsfile"""))
+
+
+def conv (str):
+ def sub_cxx_id (m):
+ str = m.group(1)
+ return 'ly:' + str.lower ().replace ('_','-')
+
+ str = re.sub (r'([A-Z][a-z_0-9]+::[a-z_0-9]+)',
+ sub_cxx_id, str)
+ return str
+
+conversions.append (((2, 7, 31), conv,
+ """Foo_bar::bla_bla -> ly:foo-bar::bla-bla"""))
+
+
+def conv (str):
+ identifier_subs = [
+ ('inputencoding', 'input-encoding'),
+ ('printpagenumber', 'print-page-number'),
+ ('outputscale', 'output-scale'),
+ ('betweensystemspace', 'between-system-space'),
+ ('betweensystempadding', 'between-system-padding'),
+ ('pagetopspace', 'page-top-space'),
+ ('raggedlastbottom', 'ragged-last-bottom'),
+ ('raggedright', 'ragged-right'),
+ ('raggedlast', 'ragged-last'),
+ ('raggedbottom', 'ragged-bottom'),
+ ('aftertitlespace', 'after-title-space'),
+ ('beforetitlespace', 'before-title-space'),
+ ('betweentitlespace', 'between-title-space'),
+ ('topmargin', 'top-margin'),
+ ('bottommargin', 'bottom-margin'),
+ ('headsep', 'head-separation'),
+ ('footsep', 'foot-separation'),
+ ('rightmargin', 'right-margin'),
+ ('leftmargin', 'left-margin'),
+ ('printfirstpagenumber', 'print-first-page-number'),
+ ('firstpagenumber', 'first-page-number'),
+ ('hsize', 'paper-width'),
+ ('vsize', 'paper-height'),
+ ('horizontalshift', 'horizontal-shift'),
+ ('staffspace', 'staff-space'),
+ ('linethickness', 'line-thickness'),
+ ('ledgerlinethickness', 'ledger-line-thickness'),
+ ('blotdiameter', 'blot-diameter'),
+ ('staffheight', 'staff-height'),
+ ('linewidth', 'line-width'),
+ ('annotatespacing', 'annotate-spacing')
+ ]
+
+ for (a,b) in identifier_subs:
+ ### for C++:
+ ## str = re.sub ('"%s"' % a, '"%s"' b, str)
+
+ str = re.sub (a, b, str)
+ return str
+
+conversions.append (((2, 7, 32), conv,
+ _ ("foobar -> foo-bar for \paper, \layout")))
+
+def conv (str):
+ str = re.sub ('debug-beam-quanting', 'debug-beam-scoring', str)
+ return str
+
+conversions.append (((2, 7, 32), conv,
+ """debug-beam-quanting -> debug-beam-scoring"""))
+
+def conv (str):
+ str = re.sub ('def-music-function', 'define-music-function', str)
+ str = re.sub ('def-markup-command', 'define-markup-command', str)
+ return str
+
+conversions.append (((2, 7, 36), conv,
+ """def-(music-function|markup-command) -> define-(music-function|markup-command)"""))
+
+
+
+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):
+ stderr_write ("\n")
+ stderr_write ("tupletNumberFormatFunction has been removed. Use #'text property on TupletNumber")
+ stderr_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)
+ ## FIXME: standard vs default, alteration-FOO vs FOO-alteration
+ str = str.replace ('alteration-default-glyph-name-alist',
+ 'standard-alteration-glyph-name-alist')
+ return str
+
+conversions.append (((2, 11, 6), conv, _ ("Rename accidental glyphs, use glyph-name-alist.")))
+
+
+def conv (str):
+ str = re.sub (r'(\\set\s+)?([A-Z][a-zA-Z]+\s*\.\s*)allowBeamBreak',
+ r"\override \2Beam #'breakable", str)
+ str = re.sub (r'(\\set\s+)?allowBeamBreak',
+ r"\override Beam #'breakable", str)
+ str = re.sub (r'addquote' , 'addQuote', str)
+ if re.search ("Span_dynamic_performer", str):
+ stderr_write ("Span_dynamic_performer has been merged into Dynamic_performer")
+
+ return str
+
+conversions.append (((2, 11, 10), conv, """allowBeamBreak -> Beam #'breakable = ##t
+addquote -> addQuote
+"""))
+
+def conv (str):
+ str = re.sub (r'\(layout-set-staff-size \(\*\s*([0-9.]+)\s*(pt|mm|cm)\)\)',
+ r'(layout-set-absolute-staff-size (* \1 \2))', str)
+ return str
+
+conversions.append (((2, 11, 11), conv, """layout-set-staff-size -> layout-set-absolute-staff-size"""))
+
+
+def conv (str):
+ str = re.sub (r"\\override\s*([a-zA-Z.]+)\s*#'arrow\s*=\s*##t",
+ r"\\override \1 #'bound-details #'right #'arrow = ##t",
+ str)
+
+ if re.search ('edge-text', str):
+ stderr_write (NOT_SMART % _ ("edge-text settings for TextSpanner."))
+ stderr_write (_ ("Use\n\n%s") %
+ "\t\\override TextSpanner #'bound-details #'right #'text = <right-text>\n"
+ "\t\\override TextSpanner #'bound-details #'left #'text = <left-text>\n")
+
+
+ return str
+
+conversions.append (((2, 11, 13), conv, """#'arrow = ##t -> #'bound-details #'right #'arrow = ##t"""))
+
+def conv (str):
+ def sub_edge_height (m):
+ s = ''
+ for (var, h) in [('left', m.group (3)),
+ ('right', m.group (4))]:
+
+ if h and float (h):
+ once = m.group(1)
+ if not once:
+ once = ''
+
+ s += (r"%s \override %s #'bound-details #'%s #'text = \markup { \draw-line #'(0 . %s) }"
+ % (once, m.group (2), var, h))
+
+ s += '\n'
+
+ return s
+
+
+ str = re.sub (r"(\\once)?\s*\\override\s*([a-zA-Z.]+)\s*#'edge-height\s*=\s*#'\(([0-9.-]+)\s+[.]\s+([0-9.-]+)\)",
+ sub_edge_height, str)
+ return str
+
+conversions.append (((2, 11, 15), conv, """#'edge-height -> #'bound-details #'right/left #'text = ..."""))
+
+def conv (str):
+ str = re.sub (r"\\override\s*([a-zA-Z.]+)\s*#'break-align-symbol\s*=\s*#'([a-z-]+)",
+ r"\\override \1 #'break-align-symbols = #'(\2)", str)
+ return str
+
+conversions.append (((2, 11, 23), conv, """#'break-align-symbol -> #'break-align-symbols"""))
+
+def conv (str):
+ str = re.sub (r"scripts\.caesura",
+ r"scripts.caesura.curved", str)
+
+ if re.search ('dash-fraction', str):
+ stderr_write (NOT_SMART % _ ("all settings related to dashed lines.\n"))
+ stderr_write (_ ("Use \\override ... #'style = #'line for solid lines and\n"))
+ stderr_write (_ ("\t\\override ... #'style = #'dashed-line for dashed lines."))
+
+ return str
+
+conversions.append (((2, 11, 35), conv, """scripts.caesura -> scripts.caesura.curved.
+""" + _ ("Use #'style not #'dash-fraction to select solid/dashed lines.")))
+
+def conv (str):
+ str = re.sub (r"setEasyHeads", r"easyHeadsOn", str)
+ str = re.sub (r"fatText", r"textLengthOn", str)
+ str = re.sub (r"emptyText", r"textLengthOff", str)
+ return str
+
+conversions.append (((2, 11, 38), conv, """\\setEasyHeads -> \\easyHeadsOn, \\fatText -> \\textLengthOn,
+\\emptyText -> \\textLengthOff"""))