summaryrefslogtreecommitdiff
path: root/Documentation/snippets/broken-crescendo-hairpin.ly
blob: db3ba99f0dd0ed08041e97408fac21f85c51cc33 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
%% DO NOT EDIT this file manually; it is automatically
%% generated from LSR http://lsr.dsi.unimi.it
%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
%% and then run scripts/auxiliar/makelsr.py
%%
%% This file is in the public domain.
\version "2.17.6"

\header {
  lsrtags = "contemporary-notation, expressive-marks, symbols-and-glyphs"

  texidoc = "
In order to make parts of a crescendo hairpin invisible, the following
method is used: A white rectangle is drawn on top of the respective
part of the crescendo hairpin, making it invisible.  The rectangle is
defined as postscript code within a text markup.

To fine-tune the position and size of the markup, the number preceding
@code{setgray} in the postscript definition can be set to a value less
than one, making it grey.  The two numbers before @code{scale} in the
postscript code are responsible for the width and height of the
rectangle, the two numbers before @code{translate} change the x- and
y-origin of the rectangle.


Make sure to put the hairpin in a lower layer than the text markup to
draw the rectangle over the hairpin.

"
  doctitle = "Broken Crescendo Hairpin"
} % begin verbatim


\relative c' {
  <<
    {
      \dynamicUp
      \override DynamicLineSpanner.staff-padding = #4
      r2 r16 c'8.\pp r4
    }
    \\
    {
      \override DynamicLineSpanner.layer = #0
      des,2\mf\< ~
      \override TextScript.layer = #2
      des16_\markup {
        \postscript #"
          1.9 -8 translate
          5 4 scale
          1 setgray
          0 0 moveto
          0 1 lineto
          1 1 lineto
          1 0 lineto
          0 0 lineto
          fill"
      }
      r8. des4 ~ des16->\sff
    }
  >>
}