]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/convert-ly.py
* scripts/convert-ly.py (FatalConversionError.conv): add rule for
[lilypond.git] / scripts / convert-ly.py
index bcdd1f261cb295a3c01adda7c13b88baf2f2b45f..25bb3e215be139b7e714b446a2a6ed45cc3c4783 100644 (file)
@@ -840,6 +840,35 @@ if 1:
        
        conversions.append (((1,5,38), conv, 'SystemStartDelimiter -> systemStartDelimiter'))
 
+
+if 1:
+       def conv (str):
+       
+               def func(match):
+                       break_dict = {
+                       "Instrument_name": "instrument-name",
+                       "Left_edge_item": "left-edge",
+                       "Span_bar": "span-bar",
+                       "Breathing_sign": "breathing-sign",
+                       "Staff_bar": "staff-bar",
+                       "Clef_item": "clef",
+                       "Key_item": "key-signature",
+                       "Time_signature": "time-signature",
+                       "Custos": "custos"
+                       }
+                       props =  match.group (1)
+                       for (k,v) in break_dict.items():
+                               props = re.sub (k, v, props)
+                       return  "breakAlignOrder = #'(%s)" % props
+
+               str = re.sub ("breakAlignOrder *= *#'\\(([a-z_\n\tA-Z ]+)\\)",
+                             func, str)
+               return str
+
+       # 40 ? 
+       conversions.append (((1,5,40), conv, 'breakAlignOrder property names'))
+       
+
 if 1:
        def conv (str):
                str = re.sub ('noAutoBeaming *= *##f', 'autoBeaming = ##t', str)
@@ -875,11 +904,13 @@ if 1:
 
 if 1:
        def conv (str):
-               str = re.sub ('MinimumVerticalExtent', 'MinimumV@rticalExtent', str)
-               str = re.sub ('ExtraVerticalExtent', 'ExtraV@rticalExtent', str)
+               str = re.sub ('MinimumVerticalExtent', 'minimumV@rticalExtent', str)
+               str = re.sub ('minimumVerticalExtent', 'minimumV@rticalExtent', str)            
+               str = re.sub ('ExtraVerticalExtent', 'extraV@rticalExtent', str)
+               str = re.sub ('extraVerticalExtent', 'extraV@rticalExtent', str)                
                str = re.sub ('VerticalExtent', 'verticalExtent', str)
-               str = re.sub ('ExtraV@rticalExtent', 'extraVerticalExtent', str)
-               str = re.sub ('MinimumV@rticalExtent', 'minimumVerticalExtent', str)            
+               str = re.sub ('extraV@rticalExtent', 'extraVerticalExtent', str)
+               str = re.sub ('minimumV@rticalExtent', 'minimumVerticalExtent', str)            
                return str
 
        conversions.append (((1,5,59), conv,
@@ -907,39 +938,54 @@ if 1:
 
 if 1:
        def conv (str):
-               str = re.sub ('ly-set-grob-property', 'ly-set-grob-property!', str)
-               str = re.sub ('ly-set-mus-property', 'ly-set-mus-property!', str)               
+               str = re.sub ('ly-set-grob-property([^!])', 'ly-set-grob-property!\1', str)
+               str = re.sub ('ly-set-mus-property([^!])', 'ly-set-mus-property!\1', str)               
                return str
        
        conversions.append (((1,5,68), conv, 'ly-set-X-property -> ly-set-X-property!'))
 
 if 1:
        def conv (str):
+               str = re.sub ('extent-X', 'X-extent', str)
+               str = re.sub ('extent-Y', 'Y-extent', str)              
+               return str
        
-               def func(match):
-                       break_dict = {
-                       "Instrument_name": "instrument-name",
-                       "Left_edge_item": "left-edge",
-                       "Span_bar": "span-bar",
-                       "Breathing_sign": "breathing-sign",
-                       "Staff_bar": "staff-bar",
-                       "Clef_item": "clef",
-                       "Key_item": "key-signature",
-                       "Time_signature": "time-signature",
-                       "Custos": "custos"
-                       }
-                       props =  match.group (1)
-                       for (k,v) in break_dict.items():
-                               props = re.sub (k, v, props)
-                       return  "breakAlignOrder = #'(%s)" % props
+       conversions.append (((1,5,71), conv, 'extent-[XY] -> [XY]-extent'))
 
-               str = re.sub ("breakAlignOrder *= *#'\\(([a-z_\n\tA-Z ]+)\\)",
-                             func, str)
+
+if 1:
+       def conv (str):
+               str = re.sub ("""#\(set! +point-and-click +line-column-location\)""",
+                             """#(set-point-and-click! \'line-column)""", str)
+               str = re.sub ("""#\(set![ \t]+point-and-click +line-location\)""",
+                             '#(set-point-and-click! \'line)', str)
+               str = re.sub ('#\(set! +point-and-click +#f\)',
+                             '#(set-point-and-click! \'none)', str)
                return str
+       
+       conversions.append (((1,5,72), conv, 'set! point-and-click -> set-point-and-click!'))
 
-       # 40 ? 
-       conversions.append (((1,5,40), conv, 'breakAlignOrder property names'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('flag-style', 'stroke-style', str)
+               str = re.sub (r"""Stem([ ]+)\\override #'style""", r"""Stem \\override #'flag-style""", str);
+               str = re.sub (r"""Stem([ ]+)\\set([ ]+)#'style""", r"""Stem \\set #'flag-style""", str);
+               return str
+       
+       conversions.append (((1,6,5), conv, 'Stems: flag-style -> stroke-style; style -> flag-style'))
+
+
+if 1:
+       def subst_req_name (match):
+               return "(make-music-by-name \'%sEvent)" % regularize_id (match.group(1))
+
+       def conv (str):
+               str = re.sub ('\\(ly-make-music *\"([A-Z][a-z_]+)_req\"\\)', subst_req_name, str)
+               str = re.sub ('Request_chord', 'EventChord', str)
+               return str
        
+       conversions.append (((1,7,1), conv, 'ly-make-music foo_bar_req -> make-music-by-name FooBarEvent'))
 
 ################################
 #      END OF CONVERSIONS