]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/convert-ly.py
* scm/music-functions.scm (determine-split-list): bugfixes.
[lilypond.git] / scripts / convert-ly.py
index 2c6d519f1cdc34cdc0338d2ffae09b87983fe665..3fa5f33f6cbf38eec306b8504598056a30eae846 100644 (file)
@@ -1635,7 +1635,7 @@ def conv (str):
                        if c == 'Score':
                                return ''
                        else:
-                               return r"\unset \property %s.melismaBusyProperties"  % c
+                               return r" \property %s.melismaBusyProperties \unset"  % c
                elif b == 'f':
                        return r"\property %s.melismaBusyProperties = #'(melismaBusy)"  % c
                
@@ -1644,6 +1644,69 @@ def conv (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
+"""))
+
+
+def conv (str):
+       str =re.sub (r"OttavaSpanner", r"OttavaBracket", str)
+       return str
+
+conversions.append (((2,1,12), conv, """OttavaSpanner -> OttavaBracket"""))
+
+
+def conv (str):
+       str =re.sub (r"\(set-staff-size ", r"(set-global-staff-size ", str)
+       return str
+
+conversions.append (((2,1,13), conv, """set-staff-size -> set-global-staff-size"""))
+
+def conv (str):
+       str =re.sub (r"#'style\s*=\s*#'dotted-line",
+                    r"#'dash-fraction = #0.0 ", str)
+       return str
+
+conversions.append (((2,1,14), conv, """style = dotted -> dash-fraction = 0"""))
+
 ################################
 #      END OF CONVERSIONS      
 ################################
@@ -1778,7 +1841,7 @@ identify ()
 for f in files:
        if f == '-':
                f = ''
-       if not os.path.isfile (f):
+       elif not os.path.isfile (f):
                continue
        try:
                do_one_file (f)