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