Slanted parentheses around dynamics: Difference between revisions

Conform to the format of snippets included in the official documentation
 
Line 1: Line 1:
Although the easiest way to add parentheses to a dynamic mark is to use a <code>\markup</code> block, this method has a downside: the created objects behave like text markups and not like dynamics.
The easiest way to parenthesize dynamics is to use the normal <code>\parenthesize</code> command and adjust the font size, e.g., <code>{ c'4\tweak Parentheses.font-size 2 \parenthesize \f }</code>. However, this results in upright parentheses, while dynamic marks are normally slanted. This snippet gives a method to make the parentheses slanted as well.
 
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</code> function. This way, the markup is regarded as a dynamic and therefore remains compatible with commands such as <code>\dynamicUp</code> or <code>\dynamicDown</code>.


<lilypond version="2.24">
<lilypond version="2.24">
Line 17: Line 15:
   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>