]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/center-text-below-hairpin-dynamics.ly
d588c05b53df6a6eba508a58f12ece0804c1a27f
[lilypond.git] / Documentation / snippets / center-text-below-hairpin-dynamics.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.15.40"
8
9 \header {
10   lsrtags = "expressive-marks, text, scheme-language, really-cool"
11
12 %% Translation of GIT committish: b482c3e5b56c3841a88d957e0ca12964bd3e64fa
13   texidoces = "
14 Este ejemplo proporciona una función para tipografiar un regulador con
15 texto por debajo, como @qq{molto} o @qq{poco}. El ejemplo ilustra
16 también cómo modificar la manera en que se imprime normalmente un
17 objeto, utilizando código de Scheme.
18
19 "
20   doctitlees = "Centrar texto debajo de un regulador"
21
22 %% Translation of GIT committish: f5cfaf8ef4ac347702f554af0944ef0d8396e73a
23   texidocfr = "
24 La fonction comprise dans l'extrait suivant permet d'ajouter du texte
25 -- comme @qq{molto} o @qq{poco} -- en dessous d'un soufflet de
26 (de)crescendo.  Cet exemple présente aussi comment, à l'aide de code
27 Scheme, influencer la manière dont un objet est normalement imprimé.
28
29 "
30   doctitlefr = "Texte centré sous un soufflet"
31
32   texidoc = "
33 This example provides a function to typeset a hairpin (de)crescendo
34 with some additional text below it, such as @qq{molto} or @qq{poco}.
35 The example also illustrates how to modify the way an object is
36 normally printed, using some Scheme code.
37
38 "
39   doctitle = "Center text below hairpin dynamics"
40 } % begin verbatim
41
42
43 hairpinWithCenteredText =
44 #(define-music-function (parser location text) (markup?)
45 #{
46   \override Voice.Hairpin #'stencil = #(lambda (grob)
47     (ly:stencil-aligned-to
48      (ly:stencil-combine-at-edge
49       (ly:stencil-aligned-to (ly:hairpin::print grob) X CENTER)
50       Y DOWN
51       (ly:stencil-aligned-to (grob-interpret-markup grob text) X CENTER))
52      X LEFT))
53 #})
54
55 hairpinMolto = \hairpinWithCenteredText \markup { \italic molto }
56 hairpinMore = \hairpinWithCenteredText \markup { \larger moltissimo }
57
58 \layout { ragged-right = ##f }
59
60 \relative c' {
61   \hairpinMolto
62   c2\< c\f
63   \hairpinMore
64   c2\< c\f
65 }