]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/creating-real-parenthesized-dynamics.ly
Add '-dcrop' option to ps and svg backends
[lilypond.git] / Documentation / snippets / creating-real-parenthesized-dynamics.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.19.22"
8
9 \header {
10   lsrtags = "expressive-marks, text, workaround"
11
12   texidoc = "
13 Although the easiest way to add parentheses to a dynamic mark is to use
14 a @code{\\markup} block, this method has a downside: the created
15 objects will behave like text markups, and not like dynamics.
16
17 However, it is possible to create a similar object using the equivalent
18 Scheme code (as described in the Notation Reference), combined with the
19 @code{make-dynamic-script} function. This way, the markup will be
20 regarded as a dynamic, and therefore will remain compatible with
21 commands such as @code{\\dynamicUp} or @code{\\dynamicDown}.
22
23
24
25 "
26   doctitle = "Creating \"real\" parenthesized dynamics"
27 } % begin verbatim
28
29 paren =
30 #(define-event-function (dyn) (ly:event?)
31    (make-dynamic-script
32     #{ \markup \concat {
33          \normal-text \italic \fontsize #2 (
34          \pad-x #0.2 #(ly:music-property dyn 'text)
35          \normal-text \italic \fontsize #2 )
36        }
37     #}))
38
39 \relative c'' {
40   c4\paren\f c c \dynamicUp c\paren\p
41 }