Guide, node Updating translation committishes..
@end ignore
-@c \version "2.17.6"
+@c \version "2.17.20"
@node Tweaking output
@chapter Tweaking output
@cindex color property, example
@cindex NoteHead, example of overriding
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
+@lilypond[quote,verbatim,relative=1]
c4 d
\override NoteHead.color = #red
e4 f |
b c |
@end lilypond
+The @code{\once} prefix may also be used in front of many
+predefined commands to limit their effect to one musical moment:
+
+@lilypond[quote,verbatim,relative=1]
+c4 d
+\once \stemDown
+e4 f |
+g4 a
+\once \hideNotes
+b c |
+@end lilypond
+
+However, predefined commands of the form @code{\@dots{}Neutral},
+@code{\@dots{}Off} and @code{\un@dots{}} use @code{\revert} internally
+rather than @code{\override} so prefixing these with @code{\once} has no
+effect.
+
@node The \overrideProperty command
@unnumberedsubsubsec The @code{\overrideProperty} command
@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
\tweak direction #up
-\times 4/3 {
+\tuplet 3/4 {
\tweak color #red
- \times 2/3 { c8[ c c] }
- \times 2/3 { c8[ c c] }
- \times 2/3 { c8[ c c] }
+ \tuplet 3/2 { c8[ c c] }
+ \tuplet 3/2 { c8[ c c] }
+ \tuplet 3/2 { c8[ c c] }
}
@end lilypond
@cindex TupletNumber, example of overriding
@lilypond[quote,ragged-right,verbatim,fragment,relative=1]
-\times 2/3 { c8[ c c] }
+\tuplet 3/2 { c8[ c c] }
\once \override TupletNumber.text = #tuplet-number::calc-fraction-text
-\times 2/3 {
+\tuplet 3/2 {
c8[ c]
c8[ c]
\once \override TupletNumber.transparent = ##t
- \times 2/3 { c8[ c c] }
- \times 2/3 { c8[ c c] }
+ \tuplet 3/2 { c8[ c c] }
+ \tuplet 3/2 { c8[ c c] }
}
@end lilypond
@end lilypond
The command to revert to the default behavior is
-@code{\textLengthOff}. Remember @code{\once} only works with
-@code{\override}, @code{\set}, @code{\revert} or @code{\unset},
-so cannot be used with @code{\textLengthOn}.
+@code{\textLengthOff}. Alternatively, @code{\once} may be used
+with @code{\textLengthOn} if the effect is to be limited to just a
+single musical moment.
+The corresponding spacing behavior for rehearsal marks and tempo
+indications is independently controlled with the commands
+@code{\markLengthOn} and @code{\markLengthOff}.
@cindex markup text, allowing collisions
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
\dynamicUp
-a4\f b\mf c\mp b\p
+a4\f b\mf a\mp b\p
@end lilypond
@noindent
By default, outside-staff objects are given a width of zero so
that they may overlap in the horizontal direction. This is done
-by the trick of adding infinity to the leftmost extent and
-minus infinity to the rightmost extent by setting the
-@code{extra-spacing-width} to @code{'(+inf.0 . -inf.0)}. So
-to ensure they do not overlap in the horizontal direction we
-must override this value of @code{extra-spacing-width} to
-@code{'(0 . 0)} so the true width shines through. This is
-the command to do this for dynamic text:
+by the trick of making the leftmost extent infinity and
+the rightmost extent minus infinity by setting the
+@code{extra-spacing-width} to @code{'(+inf.0 . -inf.0)}. To
+ensure they do not overlap in the horizontal direction we
+must override this value of @code{extra-spacing-width} to give them
+a little extra spacing. The units are the space between two staff
+lines, so moving the left edge half a unit to the left and the
+right edge half a unit to the right should do it:
@example
-\override DynamicText.extra-spacing-width = #'(0 . 0)
+\override DynamicText.extra-spacing-width = #'(-0.5 . 0.5)
@end example
@noindent
@cindex DynamicText, example of overriding
@cindex extra-spacing-width property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-\dynamicUp
-\override DynamicText.extra-spacing-width = #'(0 . 0)
-a4\f b\mf c\mp b\p |
-@end lilypond
-
-@noindent
-Well, it has certainly stopped the dynamic marks being
-displaced, but two problems remain. The marks should be
-spaced a little further apart and it would be better
-if they were all the same distance from the staff.
-We can solve the first problem easily. Instead of making
-the @code{extra-spacing-width} zero we could add a little
-more to it. The units are the space between two staff
-lines, so moving the left edge half a unit to the left and the
-right edge half a unit to the right should do it:
-
-@cindex DynamicText, example of overriding
-@cindex extra-spacing-width property, example
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
\dynamicUp
% Extend width by 1 staff space
\override DynamicText.extra-spacing-width = #'(-0.5 . 0.5)
-a4\f b\mf c\mp b\p
+a4\f b\mf a\mp b\p
@end lilypond
@noindent
\override DynamicText.extra-spacing-width = #'(-0.5 . 0.5)
% Align dynamics to a base line 2 units above staff
\override DynamicLineSpanner.staff-padding = #2
-a4\f b\mf c\mp b\p
+a4\f b\mf a\mp b\p
@end lilypond
@node The self-alignment-X property
@unnumberedsubsubsec The @code{self-alignment-X} property
-The following example shows how this can resolve the collision
-of a string fingering object with a note's stem by aligning the
+The following example shows how to adjust the position
+of a string fingering object relative to a note's stem by aligning the
right edge with the reference point of the parent note:
@cindex StringNumber, example of overriding
<< { c4 c c c } \\ { R1 } >>
@end lilypond
-The best solution here is to move the multimeasure rest down, since
-the rest is in voice two. The default in @code{\voiceTwo} (i.e. in
-the second voice of a @code{<<@{...@} \\ @{...@}>>} construct) is that
-@code{staff-position} is set to -4 for MultiMeasureRest, so we need to
-move it, say, four half-staff spaces down to @w{@code{-8}}.
+The best solution here is to move the multimeasure rest down, since the
+rest is in voice two. The default in @code{\voiceTwo} (i.e. in the
+second voice of a @code{<<@{@dots{}@} \\ @{@dots{}@}>>} construct) is
+that @code{staff-position} is set to -4 for MultiMeasureRest, so we need
+to move it, say, four half-staff spaces down to @w{@code{-8}}.
@cindex MultiMeasureRest, example of overriding
@cindex staff-position property, example
second voice.
@node The force-hshift property
-@unnumberedsubsubsec The @code{force-hshift property}
+@unnumberedsubsubsec The @code{force-hshift} property
We can now see how to apply the final corrections to the Chopin
example introduced at the end of @ref{I'm hearing Voices}, which
\stemDown
% Stem on the d2 should be invisible
\tweak Stem.transparent ##t
- \tweak Flag.transparent ##t
d2
}
\new Voice {
\stemDown
% Stem on the d2 should be invisible
\tweak Stem.transparent ##t
- \tweak Flag.transparent ##t
d2
}
\new Voice {
@menu
* Other uses for tweaks::
-* Using variables for tweaks::
+* Using variables for layout adjustments::
* Style sheets::
* Other sources of information::
* Advanced tweaks with Scheme::
<<
{
\tweak Stem.transparent ##t
- \tweak Flag.transparent ##t
b8~ b\noBeam
}
\\
<<
{
\tweak Stem.transparent ##t
- \tweak Flag.transparent ##t
\tweak Stem.length #8
b8~ b\noBeam
}
Music Glossary:
@rglos{system}.
-@node Using variables for tweaks
-@subsection Using variables for tweaks
+@node Using variables for layout adjustments
+@subsection Using variables for layout adjustments
-@cindex variables, using for tweaks
-@cindex using variables for tweaks
-@cindex tweaks, using variables for
+@cindex variables, using for overrides
+@cindex overrides, using variables for
+@cindex adjustments, using variables for
+@cindex layout adjustments, using variables for
Override commands are often long and tedious to type, and they
have to be absolutely correct. If the same overrides are to be
#(define-music-function
(parser location string)
(string?)
- #{ ^\markup \bold \box #string #})
+ #{ <>^\markup \bold \box #string #})
\relative c'' {
\tempo 4=50
#(define-music-function
(parser location string)
(string?)
- #@{ ^\markup \bold \box #string #@})
+ #@{ <>^\markup \bold \box #string #@})
@end example
We will refer to this file using the @code{\include} command near
#(define-music-function
(parser location string)
(string?)
- #{ ^\markup \bold \box #string #})
+ #{ <>^\markup \bold \box #string #})
\relative c'' {
\tempo 4=50
#(define-music-function
(parser location string)
(string?)
- #@{ ^\markup \bold \box #string #@})
+ #@{ <>^\markup \bold \box #string #@})
\layout@{
\context @{
\Score
- \override MetronomeMark.extra-offset = #'(-9 . 0)
+ \override MetronomeMark.extra-offset = #'(-5 . 0)
\override MetronomeMark.padding = #'3
@}
\context @{
#(define-music-function
(parser location string)
(string?)
- #{ ^\markup \bold \box #string #})
+ #{ <>^\markup \bold \box #string #})
\layout{
\context {
\Score
- \override MetronomeMark.extra-offset = #'(-9 . 0)
+ \override MetronomeMark.extra-offset = #'(-5 . 0)
\override MetronomeMark.padding = #'3
}
\context {
#(define-music-function
(parser location string)
(string?)
- #@{ ^\markup \bold \box #string #@})
+ #@{ <>^\markup \bold \box #string #@})
#(set-global-staff-size 23)
\layout@{
\context @{
\Score
- \override MetronomeMark.extra-offset = #'(-9 . 0)
+ \override MetronomeMark.extra-offset = #'(-5 . 0)
\override MetronomeMark.padding = #'3
@}
\context @{
#(define-music-function
(parser location string)
(string?)
- #{ ^\markup \bold \box #string #})
+ #{ <>^\markup \bold \box #string #})
#(set-global-staff-size 23)
\layout{
\context { \Score
- \override MetronomeMark.extra-offset = #'(-9 . 0)
+ \override MetronomeMark.extra-offset = #'(-5 . 0)
\override MetronomeMark.padding = #'3
}
\context { \Voice