]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/center-text-below-hairpin-dynamics.ly
Merge branch 'master' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / input / lsr / center-text-below-hairpin-dynamics.ly
1 %% Do not edit this file; it is auto-generated from LSR!
2 %% Tags: expressive-marks, text
3 \version "2.11.35"
4
5 \header { texidoc = "
6 This example provides a function to typeset hairpin (de)crescendo with
7 some additional text below it, such as \"molto\" or \"poco\". 
8
9 The example also illustrates how to use modify the way an object
10 normally is printed, using some Scheme code.  
11 " }
12
13 hairpinWithCenteredText = #(define-music-function
14                           (parser location text) (markup?)
15 #{
16 \override Voice.Hairpin #'stencil = #(lambda (grob)
17  (ly:stencil-aligned-to
18   (ly:stencil-combine-at-edge
19    (ly:stencil-aligned-to (ly:hairpin::print grob) X CENTER)
20    Y
21    DOWN
22    (ly:stencil-aligned-to (ly:text-interface::print grob) X CENTER))
23   X LEFT))
24 \override Voice.Hairpin #'text = $text
25 #})
26
27
28 hairpinMolto = \hairpinWithCenteredText \markup {\italic "molto"}
29 hairpinMore  = \hairpinWithCenteredText \markup {\bigger "moltissimo"}
30
31 \new Staff {
32    \hairpinMolto c'2\< c'2\f
33    \hairpinMore  c'2\< c'2\f
34 }
35