]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/dynamics-text-spanner-postfix.ly
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / Documentation / snippets / new / dynamics-text-spanner-postfix.ly
1 \version "2.13.4"
2
3 \header {
4   lsrtags = "expressive-marks, tweaks-and-overrides"
5   texidoc = "The \cresc, \dim and \decresc spanners can now be redefined as
6 postfix operators and produce one text spanner.  Defining custom spanners is
7 also easy.  Hairpin and text crescendi can be easily mixed. \< and \> produce
8 hairpins by default, \cresc etc. produce text spanners by default.
9 "
10   doctitle = "Dynamics text spanner postfix"
11 }
12
13 % Some sample text dynamic spanners, to be used as postfix operators
14 crpoco =
15 #(make-music 'CrescendoEvent
16              'span-direction START
17              'span-type 'text
18              'span-text "cresc. poco a poco")
19 % Redefine the existing \cresc, \dim and \decresc commands to use postfix syntax
20 cresc =
21 #(make-music 'CrescendoEvent
22              'span-direction START
23              'span-type 'text
24              'span-text "cresc.")
25 dim =
26 #(make-music 'DecrescendoEvent
27              'span-direction START
28              'span-type 'text
29              'span-text "dim.")
30 decresc =
31 #(make-music 'DecrescendoEvent
32              'span-direction START
33              'span-type 'text
34              'span-text "decresc.")
35
36 \relative c' {
37   c4\cresc d4 e4 f4 |
38   g4 a4\! b4\crpoco c4 |
39   c4 d4 e4 f4 |
40   g4 a4\! b4\< c4 |
41   g4\dim a4 b4\decresc c4\!
42 }