used. Here is a simple example to change the color of the
note head:
+@cindex color property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
c d
\override NoteHead #'color = #red
in many of the following examples. Here we revert the color
of the note head to the default value for the final two notes:
+@cindex color property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
c d
\override NoteHead #'color = #red
back to its default value. Using the same example, we can
change the color of a single note like this:
+@cindex color property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
c d
\once \override NoteHead #'color = #red
middle note head (the E) in a C major chord. Let's first see what
@code{\once \override} would do:
+@cindex font-size property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
<c e g>4
\once \override NoteHead #'font-size = #-3
So to return to our example, the size of the middle note of
a chord would be changed in this way:
+@cindex font-size property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
<c e g>4
<c \tweak #'font-size #-3 e g>4
A @code{\tweak} command can also be used to modify just one in
a series of articulations, as shown here:
+@cindex color property, example
+@cindex tweak example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
a ^Black
-\tweak #'color #red ^Red
notes and the second one specifies that the tuplet number is to be
printed in red on the first short tuplet bracket.
+@cindex tweak example
+@cindex direction property, example
+@cindex color property, example
+
@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
\tweak #'direction #up
\times 4/3 {
appearance may be modified in the usual way with
@code{\override} commands:
+@cindex text property, example
+@cindex tuplet-number example
+@cindex transparent property, example
+
@c NOTE Tuplet brackets collide if notes are high on staff
@c See issue 509
@lilypond[quote,ragged-right,verbatim,fragment,relative=1]
@cindex override example
@cindex Internals Reference, example of using
+@cindex addlyrics example
Let's use a concrete example with a simple fragment of real
music:
answer is, @q{Within the music, before the first slur and
close to it.} Let's do that:
+@cindex Slur example
+@cindex thickness property, example
+
@lilypond[quote,verbatim,relative=2]
{
\time 6/8
is simply discarded. So the command with @code{\once} must be
repositioned as follows:
+@cindex Slur example
+@cindex thickness property, example
+
@lilypond[quote,verbatim,relative=2]
{
\time 6/8
@code{\once} placed immediately before each of the notes where
the slurs begin:
+@cindex Slur example
+@cindex thickness property, example
+
@lilypond[quote,verbatim,relative=2]
{
\time 6/8
command to return the @code{thickness} property to its default value
after the second slur:
+@cindex Slur example
+@cindex thickness property, example
+
@lilypond[quote,verbatim,relative=2]
{
\time 6/8
and this should be placed just in front of and close to the
lyrics which it should affect, like this:
+@cindex font-shape property, example
+@cindex italic example
+@cindex LyricText example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 6/8
setting its value to @code{#f}. Let's try it, as before, omitting
the implied Context, @code{Voice}:
+@cindex BarLine example
+@cindex stencil property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
produced, and nothing is logged in the log file. Let's try correcting
it by adding the correct context:
+@cindex BarLine example
+@cindex stencil property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
required, as always, to precede the value itself in the
@code{\override} command.
+@cindex BarLine example
+@cindex break-visibility property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
@code{grob-interface}. So the command to make the time signature
transparent is:
+@cindex TimeSignature example of overriding
+@cindex transparent property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
stencil for the time signature should be set to @code{#f}
instead:
+@cindex TimeSignature, example of overriding
+@cindex stencil property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
@ruser{List of colors}. To set the bar lines to white
we write:
+@cindex BarLine, example of overriding
+@cindex color property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
converts X11 color names into the list of internal values,
@code{x11-color}, like this:
+@cindex BarLine, example of overriding
+@cindex color property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
set the color to red the value should be @code{(rgb-color 1 0 0)}
and to white it should be @code{(rgb-color 1 1 1)}:
+@cindex BarLine, example of overriding
+@cindex color property, example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
this by setting all the layout objects in our example to
various shades of grey:
+@cindex StaffSymbol, example of overriding
+@cindex TimeSignature, example of overriding
+@cindex Clef, example of overriding
+@cindex NoteHead, example of overriding
+@cindex Stem, example of overriding
+@cindex BarLine, example of overriding
+@cindex color property, example
+@cindex x11-color, example of using
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
{
\time 12/16
see @ref{Nesting music expressions}) which showed
how to introduce a new temporary staff, as in an @rglos{ossia}.
+@cindex alignAboveContext property, example
+@cindex @code{\with} example
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
\new Staff ="main" {
\relative g' {
already know now how to remove the clef and time signature --
we simply set the stencil of each to @code{#f}, as follows:
+@cindex alignAboveContext property, example
+@cindex @code{\with} example
+@cindex stencil property, example
+@cindex Clef, example of overriding
+@cindex TimeSignature, example of overriding
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
\new Staff ="main" {
\relative g' {
required to ensure the enclosed overrides and music are applied
to the ossia staff.
-But what is the difference between modifying the staff context by
+But what is the difference between modifying the staff context by
using @code{\with} and modifying the stencils of the clef and the
-time signature with \override? The main difference is that
+time signature with \override? The main difference is that
changes made in a @code{\with} clause are made at the time the
context is created, and remain in force as the @strong{default}
values for the duration of that context, whereas
music are dynamic -- they make changes synchronized with
a particular point in the music. If changes are unset or
reverted using @code{\unset} or @code{\revert} they return to
-their default values, which will be the ones set in the
+their default values, which will be the ones set in the
@code{\with} clause, or if none have been set there, the normal
default values.
So we could replace the example above with
+@cindex alignAboveContext property, example
+@cindex @code{\with} example
+@cindex Clef, example of overriding
+@cindex TimeSignature, example of overriding
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
\new Staff ="main" {
\relative g' {
Let's try it in our ossia example:
+@cindex alignAboveContext property, example
+@cindex @code{\with} example
+@cindex Clef, example of overriding
+@cindex TimeSignature, example of overriding
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
\new Staff ="main" {
\relative g' {
}
@end lilypond
-This is still not quite right. The note heads and flags are
+This is still not quite right. The note heads and flags are
smaller, but the stems are too long in proportion and the
staff lines are spaced too widely apart. These need to be
scaled down in proportion to the font reduction. The next
and returns a scaling factor suitable for reducing other
objects in proportion. It is used like this:
+@cindex alignAboveContext property, example
+@cindex @code{\with} example
+@cindex Clef, example of overriding
+@cindex TimeSignature, example of overriding
+@cindex fontsize property, example
+@cindex StaffSymbol, example
+@cindex magstep, example of using
+
@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
\new Staff ="main" {
\relative g' {
For small changes in scale, as in the example above, the
thickness of the various drawn lines such as bar lines,
-beams, hairpins, slurs, etc does not usually require global
+beams, hairpins, slurs, etc does not usually require global
adjustment. If the thickness of any particular layout object
needs to be adjusted this can be best achieved by overriding its
@code{thickness} property. An example of changing the thickness
of slurs was shown above in @ref{Properties of layout objects}.
The thickness of all drawn objects (i.e., those not produced
-from a font) may be changed in the same way.
+from a font) may be changed in the same way.
@node Placement of objects
@section Placement of objects
@menu
-* Automatic behavior::
-* Within-staff objects::
-* Outside-staff objects::
+* Automatic behavior::
+* Within-staff objects::
+* Outside-staff objects::
@end menu