LilyPond will interpret the file as though the music expression
was wrapped up inside a @code{\score@{@}}.
-@smallspace
-
A @code{\score} must begin with a compound music expression.
Remember that a music expression could be anything from a single
note to a huge
Notation Reference - @ruser{Score layout} and
@ruser{Creating MIDI files}.
-@smallspace
-
@cindex variables
Another great shorthand is the ability to define variables. All
Vocal music presents a special difficulty: we need to combine two
expressions -- notes and lyrics.
-You have already seen the @code{\addlyricsd@{@}} command, which
+You have already seen the @code{\addlyrics@{@}} command, which
handles simple scores well. However, this technique is
quite limited. For more complex music, you must introduce the
lyrics in a @code{Lyrics} context using @code{\new Lyrics} and
@menu
* Contexts explained::
* Creating contexts::
-* Engravers::
-* Modifying contexts::
+* Engravers explained::
+* Modifying context properties::
+* Adding and removing engravers::
@end menu
@node Contexts explained
the entire score.
Within LilyPond, these rules and bits of information are grouped
-in @emph{Contexts}. We have already met the @context{Voice}
-context.
+in @emph{Contexts}. We have already met the
+@context{Voice} context.
Others are the @context{Staff} and @context{Score} contexts.
Contexts are hierarchical to reflect the heirarchical nature of
a musical score.
@node Creating contexts
@subsection Creating contexts
-There can be only one top level context: the @context{Score}
+There can be only one top level context: the
+@context{Score}
context. This is created with the @code{\score} command,
or, in simple scores, it is created automatically.
lyrics in @ref{Voices and vocals}.
-@node Engravers
-@subsection Engravers
+@node Engravers explained
+@subsection Engravers explained
+
+cindex engravers
Every mark on the printed output of a score produced by LilyPond
is produced by an @code{Engraver}. Thus there is an engraver
by modifying the action of Engravers.
-@node Modifying contexts
-@subsection Modifying contexts
+@node Modifying context properties
+@subsection Modifying context properties
@cindex context properties
@funindex \set
@smallspace
Before we can set any of these properties we need to know
-which context they operate in. Sometimes this is obvious,
+in which context they operate. Sometimes this is obvious,
but occasionally it can be tricky. If the wrong context
is specified, no error message is produced, but the expected
action will not be taken. For example, the
@code{instrumentName} clearly lives in the Staff context, since
it is the staff that is to be named.
-In this example the first staff is labelled, but the second,
-Alto, staff is not, because we omitted the context name.
+In this example the first staff is labelled, but not the second,
+because we omitted the context name.
@lilypond[quote,verbatim,ragged-right]
<<
c4 c
}
\new Staff \relative c' {
- \set instrumentName = "Alto"
+ \set instrumentName = "Alto" % Wrong!
d4 d
}
>>
If it is set to false in the @context{Score} context
it applies to all staves.
-So this turns of extra naturals in one staff:
+So this turns off extra naturals in one staff:
@lilypond[quote,verbatim,ragged-right]
<<
may still be changed dynamically using @code{\set} and
@code{\unset}.
+@node Adding and removing engravers
+@subsection Adding and removing engravers
@cindex Engravers, adding
@cindex Engravers, removing