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