]> git.donarmstrong.com Git - lilypond.git/blob - input/new/broken-crescendo-hairpin.ly
Merge master into nested-bookparts
[lilypond.git] / input / new / broken-crescendo-hairpin.ly
1 \version "2.11.61"
2
3 \header {
4   lsrtags = "expressive-marks"
5   texidoc = "
6 In order to make parts of a crescendo hairpin invisible, the following
7 method is used: A white rectangle is drawn on top of the respective
8 part of the crescendo hairpin, making it invisible.  The rectangle is
9 defined as postscript code within a text markup.
10
11 To fine-tune the position and size of the markup, the number
12 preceding @code{setgray} in the postscript definition can be set to a
13 value less than one, making it grey.  The two numbers before @code{scale}
14 in the postscript code are responsible for the width and height of the
15 rectangle, the two numbers before @code{translate} change the x- and
16 y-origin of the rectangle.
17
18 Make sure to put the hairpin in a lower layer than the text markup to
19 draw the rectangle over the hairpin.
20 "
21   doctitle = "Broken crescendo hairpin"
22 }
23
24 \relative c' {
25   << {
26     \dynamicUp
27     \override DynamicLineSpanner #'staff-padding = #4
28     r2 r16 c'8.\pp r4
29   }
30   \\
31   {
32     \override DynamicLineSpanner #'layer = #0
33     des,2\mf\< ~
34     \override TextScript #'layer = #2
35     des16_\markup {
36       \postscript #"
37         1.9 -8 translate
38         5 4 scale
39         1 setgray
40         0 0 moveto
41         0 1 lineto
42         1 1 lineto
43         1 0 lineto
44         0 0 lineto
45         fill"
46     }
47     r8. des4 ~ des16->\sff
48   } >>
49 }