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
6 %% This file is in the public domain.
10 lsrtags = "expressive-marks, tweaks-and-overrides, correction-wanted, version-specific"
12 %% Translation of GIT committish: 57f9346bb030f49336a858fcbf1519366fe56454
14 Certaines indication de nuance requièrent un complément textuel, comme
15 « sempre pp ». Dans la mesure où les nuances sont habituellement
16 centrées sous la note, le @emph{pp} se trouvera repoussé loin après la
17 note à laquelle il s'applique.
19 Différentes approches permettent de correctement aligner horizontalement
22 -- Un simple @code{\\once \\override DynamicText #'X-offset = #-9.2}
23 avant la note considérée de telle sorte que la nuance soit décalée
24 manuellement à la bonne place. Inconvénient : il faut le faire
25 manuellement à chaque fois qu'intervient ce @emph{markup}.
27 -- L'intégration d'un rembourrage (@code{#:hspace 7.1}) à la définition
28 de cette nuance personnalisée afin qu'une fois centrée par lilypond
29 elle soit correctement alignée. Inconvénient : le rembourrage
30 occupera exactement cet espace et ne permettra à aucun autre
31 @emph{markup} ou nuance d'apparaître à cet endroit.
33 -- L'application d'un décalage au script de nuance
34 @code{\\once \\override @dots{} #'X-offset = @dots{}}.
35 Inconvénient : là aussi il faut le faire à chaque fois.
37 -- L'attribution arbitraire d'une dimension à 0 du texte additionnel à
38 l'aide d'un @code{#:with-dimensions '(0 . 0) '(0 . 0)}.
39 Inconvénient : lilypond considère que « sempre » n'occupe pas
40 d'espace, et donc pourra mettre à cet endroit d'autres éléments, ce
41 qui pourrait générer des collisions qui ne seront pas détectées par
42 les routines @emph{ad hoc}. D'autre part, il semble persister un
43 espacement, ce qui laisse l'impression d'un alignement différent en
44 l'absence de texte additionnel.
46 -- L'ajout, explicite, du décalage directement dans la fonction Scheme
49 -- La définition d'un alignement explicite au sein du script de nuance.
50 Ceci ne sera suivi d'effet, par défaut, qu'en jouant sur
51 @code{X-offset}. Inconvénient : il faut définir
52 @code{DynamicText #'X-offset}, ce qui s'appliquera à toutes les
53 nuances textuelles. Par ailleurs, l'alignement sera réalisé sur le
54 bord droit du texte additionnel, non sur le milieu de @emph{pp}.
57 doctitlefr = "Alignement de nuances personnalisées comme \"sempre pp\" \"più f\" \"subito p\""
60 Some dynamic expressions involve additional text, like @qq{sempre pp}.
61 Since dynamics are usually centered under the note, the \\pp would be
62 displayed way after the note it applies to.
64 To correctly align the @qq{sempre pp} horizontally, so that it is
65 aligned as if it were only the \\pp, there are several approaches:
67 * Simply use @code{\\once\\override DynamicText #'X-offset = #-9.2}
68 before the note with the dynamics to manually shift it to the correct
69 position. Drawback: This has to be done manually each time you use that
70 dynamic markup... * Add some padding (@code{#:hspace 7.1}) into the
71 definition of your custom dynamic mark, so that after lilypond
72 center-aligns it, it is already correctly aligned. Drawback: The
73 padding really takes up that space and does not allow any other markup
74 or dynamics to be shown in that position.
76 * Shift the dynamic script @code{\\once\\override ... #'X-offset = ..}.
77 Drawback: @code{\\once\\override} is needed for every invocation!
79 * Set the dimensions of the additional text to 0 (using
80 @code{#:with-dimensions '(0 . 0) '(0 . 0)}). Drawback: To LilyPond
81 @qq{sempre} has no extent, so it might put other stuff there and create
82 collisions (which are not detected by the collision detection!). Also,
83 there seems to be some spacing, so it's not exactly the same alignment
84 as without the additional text
86 * Add an explicit shifting directly inside the scheme function for the
89 * Set an explicit alignment inside the dynamic-script. By default, this
90 won't have any effect, only if one sets X-offset! Drawback: One needs
91 to set @code{DynamicText #'X-offset}, which will apply to all dynamic
92 texts! Also, it is aligned at the right edge of the additional text,
93 not at the center of pp.
99 doctitle = "Horizontally aligning custom dynamics (e.g. \"sempre pp\" \"piu f\" \"subito p\")"
103 \header { title = "Horizontally aligning custom dynamics" }
105 \paper { ragged-right = ##f }
107 % Solution 1: Using a simple markup with a particular halign value
108 % Drawback: It's a markup, not a dynamic command, so \dynamicDown
109 % etc. will have no effect
110 semppMarkup = \markup { \halign #1.4 \italic "sempre" \dynamic "pp" }
112 % Solution 2: Using a dynamic script & shifting with
113 % \once \override ... #'X-offset = ..
114 % Drawback: \once \override needed for every invocation
116 #(make-dynamic-script
122 % Solution 3: Padding the dynamic script so the center-alignment
123 % puts it at the correct position
124 % Drawback: the padding really reserves the space, nothing else can be there
126 #(make-dynamic-script
133 % Solution 4: Dynamic, setting the dimensions of the additional text to 0
134 % Drawback: To lilypond "sempre" has no extent, so it might put
135 % other stuff there => collisions
136 % Drawback: Also, there seems to be some spacing, so it's not exactly the
137 % same alignment as without the additional text
139 #(make-dynamic-script
141 (#:with-dimensions '(0 . 0) '(0 . 0)
147 % Solution 5: Dynamic with explicit shifting inside the scheme function
149 #(make-dynamic-script
151 #:translate '(-18.85 . 0)
152 #:line (#:normal-text
156 % Solution 6: Dynamic with explicit alignment. This has only effect
157 % if one sets X-offset!
158 % Drawback: One needs to set DynamicText #'X-offset!
159 % Drawback: Aligned at the right edge of the additional text,
160 % not at the center of pp
162 #(make-dynamic-script
163 (markup #:line (#:right-align
168 \context StaffGroup <<
169 \context Staff = "s" <<
170 \set Staff.instrumentName = #"Normal"
173 c4\pp c\p c c | c\ff c c\pp c
176 \context Staff = "sMarkup" <<
177 \set Staff.instrumentName = \markup \column { Normal markup }
180 c4-\semppMarkup c\p c c | c\ff c c-\semppMarkup c
183 \context Staff = "sK" <<
184 \set Staff.instrumentName = \markup \column { Explicit shifting }
187 \once \override DynamicText #'X-offset = #-9.2
190 \once \override DynamicText #'X-offset = #-9.2
194 \context Staff = "sT" <<
195 \set Staff.instrumentName = \markup \column { Right padding }
198 c4\semppT c\p c c | c\ff c c\semppT c
201 \context Staff = "sM" <<
202 \set Staff.instrumentName = \markup \column { Setting dimension "to zero" }
205 c4\semppM c\p c c | c\ff c c\semppM c
208 \context Staff = "sG" <<
209 \set Staff.instrumentName = \markup \column { Shifting inside dynamics }
212 c4\semppG c\p c c | c\ff c c\semppG c
215 \context Staff = "sMII" <<
216 \set Staff.instrumentName = \markup \column { Alignment inside dynamics }
219 % Setting to ##f (false) gives the same result
220 \override DynamicText #'X-offset = #0
221 c4\semppMII c\p c c | c\ff c c\semppMII c