]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/dynamics-custom-text-spanner-postfix.ly
Imported Upstream version 2.14.2
[lilypond.git] / Documentation / snippets / new / dynamics-custom-text-spanner-postfix.ly
1 \version "2.14.0"
2
3 \header {
4   lsrtags = "expressive-marks, tweaks-and-overrides"
5   texidoc = "Postfix functions for custom crescendo text spanners.  The spanners
6 should start on the first note of the measure.  One has to use -\mycresc,
7 otherwise the spanner start will rather be assigned to the next note.
8 "
9   doctitle = "Dynamics custom text spanner postfix"
10 }
11
12 % Two functions for (de)crescendo spanners where you can explicitly give the
13 % spanner text.
14 mycresc =
15 #(define-music-function (parser location mymarkup) (markup?)
16    (make-music 'CrescendoEvent
17                'span-direction START
18                'span-type 'text
19                'span-text mymarkup))
20 mydecresc =
21 #(define-music-function (parser location mymarkup) (markup?)
22    (make-music 'DecrescendoEvent
23                'span-direction START
24                'span-type 'text
25                'span-text mymarkup))
26
27 \relative c' {
28   c4-\mycresc "custom cresc" c4 c4 c4 |
29   c4 c4 c4 c4 |
30   c4-\mydecresc "custom decresc" c4 c4 c4 |
31   c4 c4\! c4 c4
32 }
33
34
35