]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add \accidentalStyle command
authorDavid Kastrup <dak@gnu.org>
Fri, 18 Nov 2011 16:02:32 +0000 (17:02 +0100)
committerDavid Kastrup <dak@gnu.org>
Wed, 23 Nov 2011 06:23:13 +0000 (07:23 +0100)
ly/property-init.ly
python/convertrules.py

index 60232edce0cd2e7462085b95c2f6e5755297b2dd..c5bf597b6e428dd8b0945cece03e2c944a25b73b 100644 (file)
@@ -14,6 +14,13 @@ defaultNoteHeads =
    (revert-head-style '(NoteHead TabNoteHead)))
 
 
+accidentalStyle =
+#(define-music-function
+   (parser location style) (string-or-symbol?)
+   (_i "Set @var{style} as the accidental style to use.")
+   (set-accidental-style (if (string? style)
+                             (string->symbol style)
+                             style)))
 
 %% arpeggios
 
index 6ea53ea37d33a1d35c316b962fdeba69b742c332..c10a22bb5231596ccbba07f2fa8633d0b9af5da7 100644 (file)
@@ -3346,6 +3346,12 @@ def conv (str):
         stderr_write ('\n')
     return str
 
+@rule ((2, 15, 20), r"$(set-accidental-style ...) -> \accidentalStyle")
+def conv (str):
+    str = re.sub (r"\$\(set-accidental-style\s+'([-a-z]+)\)",
+                  r'\\accidentalStyle "\1"', str)
+    return str
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,