From 12fecbc3e7e848785dbb4aa2e4258ca32eacedbe Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Fri, 18 Nov 2011 17:02:32 +0100 Subject: [PATCH] Add \accidentalStyle command --- ly/property-init.ly | 7 +++++++ python/convertrules.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ly/property-init.ly b/ly/property-init.ly index 60232edce0..c5bf597b6e 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -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 diff --git a/python/convertrules.py b/python/convertrules.py index 6ea53ea37d..c10a22bb52 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -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, -- 2.39.5