]> 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 a hairpin (de)crescendo
9 with some additional text below it, such as \"molto\" or \"poco\".The
10 example also illustrates how to modify the way an object is normally
11 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