Output: changing the appearance of individual
objects. For example, changing stem directions or the location of
subscripts.
-
+
@item
Context: changing aspects of the translation from music events to
-notation. For example, giving each staff a separate time signature.
-
+notation. For example, giving each staff a separate time signature.
+
@item
Global layout: changing the appearance of the spacing, line
breaks, and page dimensions. These modifications are discussed
* The \override command::
@end menu
-
+
@node Automatic notation
@section Automatic notation
this rule should apply. Set @code{n} and @code{m} to @code{'*'}
to have this apply in any time signature.
-@item @code{a/b} is the position in the bar at which the beam should
+@item @code{a/b} is the position in the bar at which the beam should
begin/end.
@item @code{context} is optional, and it specifies the context at which
example: a @context{Staff} can contain many @context{Voice}s, and a
@context{Score} can contain many @context{Staff} contexts.
-@c FIXME: doesn't work yet! -gp
-@c @image{context-example,,,eps}
+@quotation
+@image{context-example,1600%,,eps}
+@end quotation
Each context has the responsibility for enforcing some notation rules,
creating some notation objects and maintaining the associated
@ifhtml
@internalsref{Contexts}.
@end ifhtml
-@ifnothtml
+@ifnothtml
Translation @arrow{} Context.
@end ifnothtml
interpreting the @var{music expression} with that.
A practical application of @code{\new} is a score with many
-staves. Each part that should be on its own staff, is preceded with
+staves. Each part that should be on its own staff, is preceded with
@code{\new Staff}.
@lilypond[quote,verbatim,relative=2,ragged-right,fragment]
so the texts can be properly aligned to its notes,
@example
-\new Lyrics \lyricsto "@b{tenor}" @var{lyrics}
+\new Lyrics \lyricsto "@b{tenor}" @var{lyrics}
@end example
@noindent
For example,
@lilypond[quote,verbatim,relative=2,fragment]
-R1*2
+R1*2
\set Score.skipBars = ##t
R1*2
@end lilypond
have no effect.
@lilypond[quote,verbatim,relative=2,fragment]
-R1*2
+R1*2
\set skipBars = ##t
R1*2
@end lilypond
`on-the-fly', during the music, so that the setting only affects the
second group of eighth notes.
-@cindex @code{\unset}
+@cindex @code{\unset}
There is also an @code{\unset} command,
@example
specified for a bottom context, so the two statements
@example
-\set Voice.autoBeaming = ##t
-\set autoBeaming = ##t
-@end example
+\set Voice.autoBeaming = ##t
+\set autoBeaming = ##t
+@end example
@noindent
are equivalent.
@code{Note_head_engraver} and the @code{Staff} context contains a
@code{Key_signature_engraver}.
-For a full a description of each plug-in, see
+For a full a description of each plug-in, see
@ifhtml
@internalsref{Engravers}.
@end ifhtml
@ifhtml
@internalsref{Contexts}
@end ifhtml
-@ifnothtml
+@ifnothtml
Program reference @arrow Translation @arrow{} Context.
@end ifnothtml
lists the engravers used for that context.
objects. The settings used for printing these objects are also stored by
context. By changing these settings, the appearance of objects can be
altered.
-
+
The syntax for this is
@example
The command
@verbatim
-\override Staff.Stem #'thickness = #4.0
+\override Staff.Stem #'thickness = #4.0
@end verbatim
@noindent
@lilypond[quote,verbatim,relative=2,fragment]
c4
-\override Staff.Stem #'thickness = #4.0
+\override Staff.Stem #'thickness = #4.0
c4
c4
c4
Analogous to @code{\set}, the @var{context} argument may be left out,
causing it to default to @context{Voice}, and adding @code{\once} applies
-the change during one timestep only
+the change during one timestep only
@lilypond[quote,fragment,verbatim,relative=2]
c4
-\once \override Stem #'thickness = #4.0
+\once \override Stem #'thickness = #4.0
+c4
c4
-c4
@end lilypond
The @code{\override} must be done before the object is
\override Slur #'thickness = #3.0
c8[( c
\override Beam #'thickness = #0.6
-c8 c])
+c8 c])
@end lilypond
@noindent
@end example
Here @code{\Staff} takes the existing definition for context @context{Staff} from the
-identifier @code{\Staff}.
+identifier @code{\Staff}.
The statements
@example
}}
\relative c'' {
- a4 d8 bes8 \new ImproVoice { c4^"ad lib" c
- c4 c^"undress" c_"while playing :)" c }
- a1
+ a4 d8 bes8 \new ImproVoice { c4^"ad lib" c
+ c4 c^"undress" c_"while playing :)" c }
+ a1
}
@end lilypond
@example
\context @{
\Staff
- \accepts ImproVoice
+ \accepts ImproVoice
@}
@end example
\relative c'' @{
a4 d8 bes8
\new ImproVoice @{
- c4^"ad lib" c
+ c4^"ad lib" c
c4 c^"undress"
c c_"while playing :)"
@}
a1
@}
@end example
-
-
+
+
@node The \override command
@section The \override command
@item the layout object: here @code{Stem}.
@item the layout property: here @code{thickness}.
@item a sensible value: here @code{3.0}.
-@end itemize
+@end itemize
Some tweakable options are called ``subproperties'' and reside inside
properties. To tweak those, use commands in the form
@cindex internal documentation
@cindex finding graphical objects
-@cindex graphical object descriptions
+@cindex graphical object descriptions
@cindex tweaking
@cindex @code{\override}
@cindex internal documentation
@quotation
Accepted by: @internalsref{Fingering_engraver},
-@end quotation
+@end quotation
@noindent
That link brings us to the documentation for the Engraver, the
chapter lists all the definitions used and all properties that may be
tuned.
-
+
@node Layout interfaces
@subsection Layout interfaces
@quotation
@code{padding} (dimension, in staff space):
-
+
@code{0.5}
@end quotation
@node Determining the grob property
@subsection Determining the grob property
-Recall that we wanted to change the position of the @b{2} in
+Recall that we wanted to change the position of the @b{2} in
@lilypond[quote,fragment,relative=2,verbatim]
c-2
Since the @b{2} is vertically positioned next to its note, we have to
meddle with the interface associated with this positioning. This is
-done using @code{side-position-interface}. The page for this interface
+done using @code{side-position-interface}. The page for this interface
says
@quotation
@item padding
(dimension, in staff space)
-Add this much extra space between objects that are next to each other.
+Add this much extra space between objects that are next to each other.
@end table
@end quotation
\tweak #'color #red d
g
\tweak #'duration-log #1 a
->4-\tweak #'padding #10 -.
+>4-\tweak #'padding #10 -.
@end lilypond
As you can see, properties are set directly in the objects directly,
@code{studlyCaps}. They mostly control the translation from
music to notatino, eg. @code{localKeySignature} (for determining
whether to print accidentals), @code{measurePosition} (for
-determining when to print a barline). Context properties can
+determining when to print a barline). Context properties can
change value over time while interpreting a piece of music;
@code{measurePosition} is an obvious example of
this. Context properties are modified with @code{\set}.
@node Difficult tweaks
@subsection Difficult tweaks
-There are a few classes of difficult adjustments.
+There are a few classes of difficult adjustments.
@itemize @bullet
In the following example, we define a procedure
@code{my-callback}. This procedure
-
+
@itemize @bullet
@item
determines if we have been split across line breaks
@lilypond[quote,verbatim,ragged-right]
#(define (my-callback grob)
(let* (
- ; have we been split?
+ ; have we been split?
(orig (ly:grob-original grob))
; if yes, get the split pieces (our siblings)
(eq? (car (last-pair siblings)) grob))
(ly:grob-set-property! grob 'extra-offset '(-2 . 5)))))
-\relative c'' {
+\relative c'' {
\override Tie #'after-line-breaking =
#my-callback
c1 ~ \break c2 ~ c
@code{\outputProperty} function, which works similar to @code{\once
\override}, but uses a different syntax,
-@example
+@example
\outputProperty
#"Score.NonMusicalPaperColumn" % Grob name
-#'line-break-system-details % Property name
+#'line-break-system-details % Property name
#'((next-padding . 20)) % Value
@end example