]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/fundamental.itely
Update from Andrew: tweaks for cross-staff chords snippet.
[lilypond.git] / Documentation / user / fundamental.itely
index 39c726d8d03c2f4af45be4a43c5fcfc7393b3abc..7a9fb9fecdd2a25796fa01fed2964a2fbde52d00 100644 (file)
@@ -199,10 +199,6 @@ block, but a @code{\layout} block outside of a @code{\score} block
 (and thus in a @code{\book} block, either explicitly or
 implicitly) will affect every @code{\score} in that @code{\book}.
 
-Every @code{\context} block will affect the named context (e.g.,
-@code{\StaffGroup}) throughout the block (@code{\score} or
-@code{\book}) in which it appears.
-
 For details see @ruser{Multiple scores in a book}.
 
 @cindex variables
@@ -428,7 +424,7 @@ The ossia section may be placed above the staff
 as follows:
 
 @lilypond[verbatim,quote,ragged-right]
-\new Staff ="main" {
+\new Staff = "main" {
   \relative g' {
     r4 g8 g c4 c8 d |
     e4 r8
@@ -1239,7 +1235,7 @@ in separate files should they become too long.
 
 @cindex hymn structure
 
-Here is a example of the first line of a hymn with four
+Here is an example of the first line of a hymn with four
 verses, set for SATB.  In this case the words for all four
 parts are the same.  Note how we use variables to separate the
 music notation and words from the staff structure.  See too
@@ -1669,8 +1665,11 @@ context to distinguish it from other contexts of the same type,
 
 Note the distinction between the name of the context type,
 @code{Staff}, @code{Voice}, etc, and the identifying name of a
-particular instance of that type, which can be any sequence of letters
-and digits invented by the user.  The identifying name is used to
+particular instance of that type, which can be any sequence of letters 
+invented by the user.  Digits and spaces can also be used in the 
+identifying name, but then it has to be placed in quotes,
+i.e. @code{\new Staff = "MyStaff 1" @var{music-expression}}.
+The identifying name is used to
 refer back to that particular instance of a context.  We saw this in
 use in the section on lyrics, see @ref{Voices and vocals}.
 
@@ -1694,11 +1693,11 @@ about any.
 
 Engravers live and operate in Contexts.
 Engravers such as the @code{Metronome_mark_engraver}, whose
-action and output applies to the score as a whole, operate in
+action and output apply to the score as a whole, operate in
 the highest level context -- the @code{Score} context.
 
 The @code{Clef_engraver} and @code{Key_engraver} are to be
-found in every Staff Context, as different staves may require
+found in every @code{Staff} Context, as different staves may require
 different clefs and keys.
 
 The @code{Note_heads_engraver} and @code{Stem_engraver} live
@@ -1761,7 +1760,7 @@ by modifying the action of Engravers.
 
 @seealso
 
-Internals reference: @rinternals{Engravers and performers}.
+Internals reference: @rinternals{Engravers and Performers}.
 
 
 @node Modifying context properties
@@ -1840,7 +1839,7 @@ 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 take place.  For example, the
-@code{instrumentName} clearly lives in the Staff context, since
+@code{instrumentName} clearly lives in the @code{Staff} context, since
 it is the staff that is to be named.
 In this example the first staff is labelled, but not the second,
 because we omitted the context name.
@@ -1858,9 +1857,9 @@ because we omitted the context name.
 >>
 @end lilypond
 
-Remember the default context name is Voice, so the second
+Remember the default context name is @code{Voice}, so the second
 @code{\set} command set the property @code{instrumentName} in the
-Voice context to @qq{Alto}, but as LilyPond does not look
+@code{Voice} context to @qq{Alto}, but as LilyPond does not look
 for any such property in the @code{Voice} context, no
 further action took place.  This is not an error, and no error
 message is logged in the log file.
@@ -1957,6 +1956,7 @@ should be enclosed in double quotation signs, as above, although we
 shall see later that text can actually be specified in a much more
 general way by using the very powerful @code{markup} command.
 
+@unnumberedsubsubsec Setting context properties with @code{\with}
 
 @funindex \with
 @cindex context properties, setting with \with
@@ -1999,12 +1999,50 @@ value of the font size.  If it is later changed with @code{\set},
 this new default value may be restored with the
 @code{\unset fontSize} command.
 
+@unnumberedsubsubsec Setting context properties with @code{\context}
+
+The values of context properties may be set in @emph{all} contexts
+of a particular type, such as all @code{Staff} contexts, with a single
+command.  The context type is identified by using its
+type name, like @code{Staff}, prefixed by a back-slash: @code{\Staff}.
+The statement which sets the property value is the same as that in a 
+@code{\with} block, introduced above.  It is placed in a
+@code{\context} block within a @code{\layout} block.  Each
+@code{\context} block will affect all contexts of the type specified
+throughout the @code{\score} or @code{\book} block in which the
+@code{\layout} block appears.  Here is a example to show the format:
+
+@lilypond[verbatim,quote]
+\score {
+  \new Staff {
+    \relative c'' {
+      cis4 e d ces
+    }
+  }
+  \layout {
+    \context {
+      \Staff
+      extraNatural = ##t
+    }
+  }
+}
+@end lilypond
+
+@noindent
+Context properties set in this way may be overridden for particular
+instances of contexts by statements in a @code{\with} block, and by
+@code{\set} commands embedded in music statements.
+
 @seealso
 
-Notation Reference: @ruser{Changing context default settings},
-@ruser{The set command}.
+Notation Reference:
+@ruser{Changing context default settings}.
+@c FIXME
+@c uncomment when backslash-node-name issue is resolved -pm
+@c @ruser{The set command}.
 
-Internals Reference: @rinternals{Contexts},
+Internals Reference:
+@rinternals{Contexts},
 @rinternals{Tunable context properties}.
 
 
@@ -2150,7 +2188,8 @@ same way.
 
 @seealso
 
-Notation Reference: @ruser{Modifying context plug-ins}.
+Notation Reference: @ruser{Modifying context plug-ins},
+@ruser{Changing context default settings}.
 
 
 @node Extending the templates