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