Slanted parentheses around dynamics: Difference between revisions
Appearance
mNo edit summary |
Another way to parenthesize dynamic text w/o Scheme code |
||
| Line 17: | Line 17: | ||
c4\paren\f c c \dynamicUp c\paren\p | c4\paren\f c c \dynamicUp c\paren\p | ||
} | } | ||
</lilypond> | |||
Another way to do parenthesize dynamics is to use the <code>\parenthesize</code> command, although this way doesn't give you the fine-tuning of the dynamic text. | |||
<lilypond version="2.24"> | |||
\relative c'' { | |||
\override Parentheses.font-size = #2 | |||
c4\parenthesize\f c c \dynamicUp c\parenthesize\p | |||
} | |||
</lilypond> | </lilypond> | ||
Revision as of 16:16, 1 February 2026
Although the easiest way to add parentheses to a dynamic mark is to use a \markup block, this method has a downside: the created objects 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 make-dynamic-script function. This way, the markup is regarded as a dynamic and therefore remains compatible with commands such as \dynamicUp or \dynamicDown.
\version "2.24"
paren =
#(define-event-function (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
}
Another way to do parenthesize dynamics is to use the \parenthesize command, although this way doesn't give you the fine-tuning of the dynamic text.
\version "2.24"
\relative c'' {
\override Parentheses.font-size = #2
c4\parenthesize\f c c \dynamicUp c\parenthesize\p
}