Dynamics spanner with custom text: Difference between revisions
Appearance
Import snippet from LSR |
mNo edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Postfix functions for custom crescendo text spanners. The spanners should start on the first note of the measure. One has to use <code>-\mycresc</code>, otherwise the spanner start will rather be assigned to the next note. | Postfix functions for custom crescendo text spanners. The spanners should start on the first note of the measure. One has to use <code>-\mycresc</code>, otherwise the spanner start will rather be assigned to the next note. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
% Two functions for (de)crescendo spanners where you can explicitly | % Two functions for (de)crescendo spanners where you can explicitly | ||
% give the spanner text. | % give the spanner text. | ||
| Line 21: | Line 21: | ||
c4 c4 c4 c4 | | c4 c4 c4 c4 | | ||
c4-\mydecresc "custom decresc" c4 c4 c4 | | c4-\mydecresc "custom decresc" c4 c4 c4 | | ||
c4 c4 c4 c4 | | |||
c4 c4\! c4 c4 | c4 c4\! c4 c4 | ||
} | } | ||
| Line 28: | Line 29: | ||
[[Category:Tweaks and overrides]] | [[Category:Tweaks and overrides]] | ||
[[Category:Included in the official documentation]] | [[Category:Included in the official documentation]] | ||
[[Category:Snippet]] | |||
Latest revision as of 12:20, 9 December 2025
Postfix functions for custom crescendo text spanners. The spanners should start on the first note of the measure. One has to use -\mycresc, otherwise the spanner start will rather be assigned to the next note.
\version "2.24"
% Two functions for (de)crescendo spanners where you can explicitly
% give the spanner text.
mycresc =
#(define-music-function (mymarkup) (markup?)
(make-music 'CrescendoEvent
'span-direction START
'span-type 'text
'span-text mymarkup))
mydecresc =
#(define-music-function (mymarkup) (markup?)
(make-music 'DecrescendoEvent
'span-direction START
'span-type 'text
'span-text mymarkup))
\relative c' {
c4-\mycresc "custom cresc" c4 c4 c4 |
c4 c4 c4 c4 |
c4-\mydecresc "custom decresc" c4 c4 c4 |
c4 c4 c4 c4 |
c4 c4\! c4 c4
}