]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/convert-ly.py
* mf/parmesan-clefs.mf: use # quantities for char_box
[lilypond.git] / scripts / convert-ly.py
index dd6c5aed4436b77ae4ddec96736c1a412e65bc64..db608b90f4825efc992e8b5b01dbdc0ce36bb77a 100644 (file)
@@ -1285,6 +1285,14 @@ if 1:
                last_str = ''
                while last_str <> str:
                  last_str = str
+                 def sub_tremolos (m):
+                         tr = m.group (2)
+                         if tr not in slur_strs:
+                                 slur_strs.append (tr)
+                         return  m.group (1)
+                 
+                 str = re.sub (r"([a-z]+[',!? ]*)(:[0-9]+)", sub_tremolos, str)
+
                  def sub_dyn_end (m):
                          dyns.append (' \!')
                          return ' ' + m.group(2)
@@ -1424,6 +1432,8 @@ if 1:
        conversions.append (((1,9,1), conv, """Remove - before articulation"""))
 if 1:
        def conv (str):
+               str = re.sub ('ly:set-context-property',
+                             'ly:set-context-property!', str)
                str = re.sub ('\\\\newcontext', '\\\\new', str)
                str = re.sub ('\\\\grace[\t\n ]*([^{ ]+)',
                              r'\\grace { \1 }', str) 
@@ -1438,6 +1448,80 @@ if 1:
        
        conversions.append (((1,9,2), conv, """\newcontext -> \new"""))
 
+if 1:
+       def conv (str):
+               str = re.sub ('accacciatura',
+                             'acciaccatura', str)
+
+               if re.search ("context-spec-music", str):
+                       sys.stderr.write ("context-spec-music takes a symbol for the context now. Update by hand.")
+                                         
+                       raise FatalConversionError()
+               
+               str = re.sub ('fingerHorizontalDirection *= *#(LEFT|-1)',
+                             "fingeringOrientations = #'(up down left)", str)
+               str = re.sub ('fingerHorizontalDirection *= *#(RIGHT|1)',
+                             "fingeringOrientations = #'(up down right)", str)
+
+               return str
+       
+       conversions.append (((1,9,3), conv,
+                            """\acciaccatura misspelling, fingerHorizontalDirection -> fingeringOrientations"""))
+
+
+def conv (str):
+       if re.search ('\\figures', str):
+               sys.stderr.write ("Warning: attempting automatic \\figures conversion.  Check results!");
+               
+       
+       def figures_replace (m):
+               s = m.group (1)
+               s = re.sub ('<', '@FIGOPEN@',s)
+               s = re.sub ('>', '@FIGCLOSE@',s)
+               return '\\figures { %s }' % s
+       
+       str = re.sub (r'\\figures[ \t\n]*{([^}]+)}', figures_replace, str)
+       str = re.sub (r'\\<', '@STARTCRESC@', str)
+       str = re.sub (r'\\>', '@STARTDECRESC@', str)
+       str = re.sub (r'([-^_])>', r'\1@ACCENT@', str)
+       str = re.sub (r'<<', '@STARTCHORD@', str)
+       str = re.sub (r'>>', '@ENDCHORD@', str)
+       str = re.sub (r'>', '@ENDSIMUL@', str)
+       str = re.sub (r'<', '@STARTSIMUL@', str)
+       str = re.sub ('@STARTDECRESC@', '\\>', str)
+       str = re.sub ('@STARTCRESC@', '\\<', str)
+       str = re.sub ('@ACCENT@', '>', str)
+       str = re.sub ('@ENDCHORD@', '>', str)
+       str = re.sub ('@STARTCHORD@', '<', str)
+       str = re.sub ('@STARTSIMUL@', '<<', str)
+       str = re.sub ('@ENDSIMUL@', '>>', str)
+       str = re.sub ('@FIGOPEN@', '<', str)
+       str = re.sub ('@FIGCLOSE@', '>', str)
+
+       return str
+
+conversions.append (((1,9,4), conv, 'Swap < > and << >>'))
+
+
+def conv (str):
+       str = re.sub ('HaraKiriVerticalGroup', 'RemoveEmptyVerticalGroup', str)
+
+       return str
+
+conversions.append (((1,9,5), conv, 'HaraKiriVerticalGroup -> RemoveEmptyVerticalGroup'))
+
+def conv (str):
+       if re.search ("ly:get-font", str):
+               sys.stderr.write (r"(ly:get-font foo ..)  has been replaced by" + \
+                                 " (ly:paper-get-font (ly:grob-get-paper foo) .. ).\n" +\
+                                 "please update manually.")
+               
+               raise FatalConversionError()
+       return str
+               
+
+conversions.append (((1,9,6), conv, 'ly:get-font deprecated.'))
+
 ################################
 #      END OF CONVERSIONS      
 ################################