]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/center-text-below-hairpin-dynamics.ly
LSR: Update.
[lilypond.git] / Documentation / snippets / center-text-below-hairpin-dynamics.ly
1 %% Do not edit this file; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% This file is in the public domain.
4 \version "2.13.4"
5
6 \header {
7   lsrtags = "expressive-marks, text"
8
9 %% Translation of GIT committish: b2d4318d6c53df8469dfa4da09b27c15a374d0ca
10   texidoces = "
11 Este ejemplo proporciona una función para tipografiar un regulador
12 con texto por debajo, como \"molto\" o \"poco\". El ejemplo
13 ilustra también cómo modificar la manera en que se imprime
14 normalmente un objeto, utilizando código de Scheme.
15
16 "
17   doctitlees = "Centrar texto debajo de un regulador"
18
19   texidoc = "
20 This example provides a function to typeset a hairpin (de)crescendo
21 with some additional text below it, such as \"molto\" or \"poco\". The
22 example also illustrates how to modify the way an object is normally
23 printed, using some Scheme code.
24
25 "
26   doctitle = "Center text below hairpin dynamics"
27 } % begin verbatim
28
29 hairpinWithCenteredText =
30 #(define-music-function (parser location text) (markup?)
31 #{
32   \override Voice.Hairpin #'stencil = #(lambda (grob)
33     (ly:stencil-aligned-to
34      (ly:stencil-combine-at-edge
35       (ly:stencil-aligned-to (ly:hairpin::print grob) X CENTER)
36       Y DOWN
37       (ly:stencil-aligned-to (grob-interpret-markup grob $text) X CENTER))
38      X LEFT))
39 #})
40
41 hairpinMolto = \hairpinWithCenteredText \markup { \italic molto }
42 hairpinMore = \hairpinWithCenteredText \markup { \larger moltissimo }
43
44 \layout { ragged-right = ##f }
45
46 \relative c' {
47   \hairpinMolto
48   c2\< c\f
49   \hairpinMore
50   c2\< c\f
51 }