]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/center-text-below-hairpin-dynamics.ly
Change stringTunings from list of semitones to list of pitches
[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.39"
5
6 \header {
7   lsrtags = "expressive-marks, text"
8
9 %% Translation of GIT committish: a874fda3641c9e02f61be5c41b215b8304b8ed00
10   texidoces = "
11 Este ejemplo proporciona una función para tipografiar un regulador con
12 texto por debajo, como @qq{molto} o @qq{poco}. El ejemplo ilustra
13 también cómo modificar la manera en que se imprime normalmente un
14 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 @qq{molto} or @qq{poco}.
22 The example also illustrates how to modify the way an object is
23 normally 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 }