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