From 1e98ab91074698a7688a3cb08a7377b75bb32524 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 4 Jun 2013 18:38:01 +0200 Subject: [PATCH] Issue 3399: Make parenthesized dynamics snippet more versatile --- .../creating-real-parenthesized-dynamics.ly | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/snippets/new/creating-real-parenthesized-dynamics.ly diff --git a/Documentation/snippets/new/creating-real-parenthesized-dynamics.ly b/Documentation/snippets/new/creating-real-parenthesized-dynamics.ly new file mode 100644 index 0000000000..bfdd1bdfbe --- /dev/null +++ b/Documentation/snippets/new/creating-real-parenthesized-dynamics.ly @@ -0,0 +1,35 @@ +\version "2.16.0" + +\header { + lsrtags = "expressive-marks, text, workaround" + + texidoc = " +Although the easiest way to add parentheses to a dynamic mark is to use +a @code{\\markup} block, this method has a downside: the created +objects will behave like text markups, and not like dynamics. + +However, it is possible to create a similar object using the equivalent +Scheme code (as described in the Notation Reference), combined with the +@code{make-dynamic-script} function. This way, the markup will be +regarded as a dynamic, and therefore will remain compatible with +commands such as @code{\\dynamicUp} or @code{\\dynamicDown}. + + + +" + doctitle = "Creating \"real\" parenthesized dynamics" +} + +paren = +#(define-event-function (parser location dyn) (ly:event?) + (make-dynamic-script + #{ \markup \concat { + \normal-text \italic \fontsize #2 ( + \pad-x #0.2 #(ly:music-property dyn 'text) + \normal-text \italic \fontsize #2 ) + } + #})) + +\relative c'' { + c4\paren\f c c \dynamicUp c\paren\p +} -- 2.39.5