]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/staff.itely
Merge branch 'master' into nested-bookparts
[lilypond.git] / Documentation / user / staff.itely
index f26c2c58039ad5e129057c5eb0dce1846901dac8..e5ae60afc22671ff2660adf55407ec129c352447 100644 (file)
@@ -37,6 +37,7 @@ with either a bracket or a brace.
 * Deeper nested staff groups::
 @end menu
 
+
 @node Instantiating new staves
 @unnumberedsubsubsec Instantiating new staves
 
@@ -114,12 +115,12 @@ Music Glossary:
 Notation Reference:
 @ref{Creating contexts},
 @ref{Percussion staves},
+@ref{Showing melody rhythms},
 @ref{Default tablatures},
-@ref{Gregorian chant contexts},
-@ref{Mensural contexts},
-@ref{Staff symbol},
 @ref{Pre-defined contexts},
-@ref{Showing melody rhythms}.
+@ref{Staff symbol},
+@ref{Gregorian chant contexts},
+@ref{Mensural contexts}.
 
 Snippets:
 @rlsr{Staff notation}.
@@ -197,9 +198,9 @@ lines are connected between the staves.
 >>
 @end lilypond
 
-The @code{PianoStaff} is almost identical to a @code{GrandStaff},
-except that it supports printing the instrument name directly.
-For details, see @ref{Instrument names}.
+The @code{PianoStaff} is identical to a @code{GrandStaff}, except
+that it supports printing the instrument name directly.  For
+details, see @ref{Instrument names}.
 
 @lilypond[verbatim,quote,relative=2]
 \new PianoStaff <<
@@ -250,10 +251,10 @@ Snippets:
 
 Internals Reference:
 @rinternals{Staff},
+@rinternals{StaffGroup},
 @rinternals{ChoirStaff},
 @rinternals{GrandStaff},
 @rinternals{PianoStaff},
-@rinternals{StaffGroup},
 @rinternals{SystemStartBar},
 @rinternals{SystemStartBrace},
 @rinternals{SystemStartBracket},
@@ -276,8 +277,8 @@ Internals Reference:
 Two additional staff-group contexts are available that can be
 nested within a @code{StaffGroup} or @code{ChoirStaff} context:
 @code{InnerStaffGroup} and @code{InnerChoirStaff}.  These contexts
-create an additional bracket next to the original bracket of their
-parent staff group.
+create a bracket next to the original bracket of their parent
+staff group.
 
 An @code{InnerStaffGroup} is treated similarly to a
 @code{StaffGroup}; bar lines are connected between each stave
@@ -285,10 +286,10 @@ within the context:
 
 @lilypond[verbatim,quote,relative=2]
 \new StaffGroup <<
-  \new Staff { c2 c }
+  \new Staff { c2 c | c2 c }
   \new InnerStaffGroup <<
-    \new Staff { g2 g }
-    \new Staff { e2 e }
+    \new Staff { g2 g | g2 g }
+    \new Staff { e2 e | e2 e }
   >>
 >>
 @end lilypond
@@ -298,12 +299,12 @@ Bar lines are @emph{not} connected between staves of an
 
 @lilypond[verbatim,quote,relative=2]
 \new ChoirStaff <<
-  \new Staff { c2 c }
+  \new Staff { c2 c | c2 c }
   \new InnerChoirStaff <<
-    \new Staff { g2 g }
-    \new Staff { e2 e }
+    \new Staff { g2 g | g2 g }
+    \new Staff { e2 e | e2 e }
   >>
-  \new Staff { c1 }
+  \new Staff { c1 | c1 }
 >>
 @end lilypond
 
@@ -330,7 +331,8 @@ Internals Reference:
 @rinternals{ChoirStaff},
 @rinternals{SystemStartBar},
 @rinternals{SystemStartBrace},
-@rinternals{SystemStartBracket}.
+@rinternals{SystemStartBracket},
+@rinternals{SystemStartSquare}.
 
 
 @node Modifying single staves
@@ -366,11 +368,10 @@ sections are also described.
 @cindex spacing of ledger lines
 @cindex number of staff lines
 
-The grob @code{StaffSymbol} is responsible for drawing the lines
-of a staff.  Its properties can be altered in order to change the
-appearance of a staff, but they must be changed before the staff
-is created.  A staff may be started or stopped at any point in the
-score.
+The lines of a staff belong to the @code{StaffSymbol} grob.
+@code{StaffSymbol} properties can be modified to change the
+appearance of a staff, but they must be modified before the staff
+is created.
 
 The number of staff lines may be changed.  The clef position and
 the position of middle C may need to be modified to fit the new
@@ -378,17 +379,15 @@ staff.  For an explanation, refer to the snippet section in
 @ref{Clef}.
 
 @lilypond[verbatim,quote,relative=2]
-\new Staff {
-  \override Staff.StaffSymbol #'line-count = #3
-  d4 d d d
+\new Staff \with {
+  \override StaffSymbol #'line-count = #3
 }
+{ d4 d d d }
 @end lilypond
 
 The vertical position of staff lines and the number of staff lines
-can be defined at the same time.  As the example shows, the
-positions of the notes are not influenced by the position of the
-staff lines.  Details for modifying this property are found in
-@rinternals{staff-symbol-interface}.
+can be defined at the same time.  As the following example shows,
+note positions are not influenced by the staff line positions.
 
 @warning{The @code{'line-positions} property overrides the
 @code{'line-count} property.  The number of staff lines is
@@ -402,7 +401,7 @@ for @code{'line-positions}}
 { a4 e' f b | d1 }
 @end lilypond
 
-The staff line thickness can be modified.  The thickness of ledger
+Staff line thickness can be modified.  The thickness of ledger
 lines and stems are also affected, since they depend on staff line
 thickness.
 
@@ -413,9 +412,8 @@ thickness.
 { e4 d c b }
 @end lilypond
 
-The thickness of ledger lines can be set independently of staff
-line thickness.  A description of this property is also found in
-@rinternals{staff-symbol-interface}.
+Ledger line thickness can be set independently of staff line
+thickness.
 
 @lilypond[verbatim,quote,relative=1]
 \new Staff \with {
@@ -424,7 +422,7 @@ line thickness.  A description of this property is also found in
 { e4 d c b }
 @end lilypond
 
-The distance between staff lines can be changed.  The setting has
+The distance between staff lines can be changed.  This setting has
 influence on ledger lines as well.
 
 @lilypond[verbatim,quote,relative=1]
@@ -434,7 +432,7 @@ influence on ledger lines as well.
 { a4 b c d }
 @end lilypond
 
-The width of a staff can be adjusted.  The unit is one staff
+The width of a staff can be modified.  The unit is one staff
 space.  The spacing of objects inside the staff is not influenced
 by this setting.
 
@@ -445,6 +443,12 @@ by this setting.
 { a4 e' f b | d1 }
 @end lilypond
 
+Further details about the properties of @code{StaffSymbol} can be
+found here: @rinternals{staff-symbol-interface}.
+
+@funindex \startStaff
+@funindex \stopStaff
+
 Modifications to staff properties in the middle of a score can be
 placed between @code{\stopStaff} and @code{\startStaff}:
 
@@ -463,9 +467,7 @@ a2 a
 
 @predefined
 
-@funindex \startStaff
 @code{\startStaff},
-@funindex \stopStaff
 @code{\stopStaff}.
 
 
@@ -495,9 +497,9 @@ Internals Reference:
 
 @knownissues
 
-When setting staff lines manually, bar lines are always drawn
-centered on the position 0, so the maximum distance of the bar
-lines in either direction must be equal.
+When setting vertical staff line positions manually, bar lines are
+always centered on position 0, so the maximum distance between the
+outermost bar lines in either direction must be equal.
 
 
 @node Ossia staves
@@ -707,22 +709,34 @@ Internals Reference:
 @node Hiding staves
 @unnumberedsubsubsec Hiding staves
 
-@cindex Frenched scores
+@cindex Frenched score
+@cindex Frenched staff
 @cindex staff, hiding
 @cindex staff, empty
 @cindex hiding of staves
 @cindex empty staves
-@cindex Frenched staves
 
-In orchestral scores, staff lines that only have rests are usually
-removed in order to save some space.  This style is called
-@q{French Score}.  For the @code{Lyrics}, @code{ChordNames}, and
-@code{FiguredBass} contexts, this is switched on by default.
+Staff lines can be hidden by removing the
+@code{Staff_symbol_engraver} from the @code{Staff} context.  As an
+alternative, @code{\stopStaff} may be used.
 
-For other staff contexts, this behavior is set with the
-@code{\RemoveEmptyStaffContext} command.  It is set in the
-@code{\layout} block.  As a result, empty staves or staves
-containing multi-measure rests are removed after a line break.
+@lilypond[verbatim,quote]
+\new Staff \with {
+  \remove "Staff_symbol_engraver"
+}
+\relative c''' { a8 f e16 d c b a2 }
+@end lilypond
+
+@funindex \RemoveEmptyStaffContext
+
+Empty staves can be hidden by setting the
+@code{\RemoveEmptyStaffContext} command in the @code{\layout}
+block.  In orchestral scores, this style is known as @q{Frenched
+Score}.  By default, this command hides all empty staves in a
+score except for those in the first system.
+
+@warning{An empty staff may only include multi-measure rests,
+skips, spacer rests, or a combination of these.}
 
 @lilypond[verbatim,quote,ragged-right]
 \layout {
@@ -730,54 +744,54 @@ containing multi-measure rests are removed after a line break.
     \RemoveEmptyStaffContext
   }
 }
-\relative c'' {
-  <<
-    \new Staff { e4 f g a \break c1 }
-    \new Staff { c4 d e f \break R1 }
-  >>
-}
+\relative c' <<
+  \new Staff {
+    e4 f g a \break
+    b1 \break
+    a4 b c2
+  }
+  \new Staff {
+    c,4 d e f \break
+    R1 \break
+    f4 g c,2
+  }
+>>
 @end lilypond
 
-To remove other types of contexts, use
-@code{\AncientRemoveEmptyStaffContext} or
-@code{\RemoveEmptyRhythmicStaffContext}.
-
 @cindex ossia
 
-Another application of @code{\RemoveEmptyStaffContext} is to make
-ossia sections, i.e., alternative melodies on a separate piece of
-staff, with help of a Frenched staff.  For details, see
-@ref{Ossia staves}.
-
-Staff lines can be made invisible by removing the
-@code{Staff_symbol_engraver} from the @code{Staff} context:
-
-@lilypond[verbatim,quote]
-\new Staff \with {
-  \remove "Staff_symbol_engraver"
-}
-\relative c'' { c8 c c16 c c c c2 }
-@end lilypond
-
+@code{\RemoveEmptyStaffContext} can also be used to create ossia
+sections for a staff.  For details, see @ref{Ossia staves}.
 
-@snippets
+@cindex hiding ancient staves
+@cindex hiding rhythmic staves
+@funindex \AncientRemoveEmptyStaffContext
+@funindex \RemoveEmptyRhythmicStaffContext
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
-{removing-the-first-empty-line.ly}
+The @code{\AncientRemoveEmptyStaffContext} command may be used to
+hide empty staves in ancient music contexts.  Similarly,
+@code{\RemoveEmptyRhythmicStaffContext} may be used to hide empty
+@code{RhythmicStaff} contexts.
 
 
 @predefined
 
-@funindex \RemoveEmptyStaffContext
 @code{\RemoveEmptyStaffContext},
-@funindex \AncientRemoveEmptyStaffContext
 @code{\AncientRemoveEmptyStaffContext},
-@funindex \RemoveEmptyRhythmicStaffContext
 @code{\RemoveEmptyRhythmicStaffContext}.
 
 
+@snippets
+
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{removing-the-first-empty-line.ly}
+
+
 @seealso
 
+Music Glossary:
+@rglos{Frenched staff}.
+
 Notation Reference:
 @ref{Staff symbol},
 @ref{Ossia staves}.
@@ -817,30 +831,40 @@ format cue notes are also described.
 @cindex metronome marking with text
 @funindex \tempo
 
-Basic metronome markings can be entered as follows:
+A basic metronome mark is simple to write:
 
-@lilypond[verbatim,quote,relative=2]
-\tempo 2 = 120
-c1
+@lilypond[verbatim,quote,relative=1]
+\tempo 4 = 120
+c2 d
+e4. d8 c2
 @end lilypond
 
-Textual tempo indications can be used instead:
+Tempo indications with text can be used instead:
 
 @lilypond[verbatim,quote,relative=2]
 \tempo "Allegretto"
-d2 c
+c4 e d c
+b4. a16 b c4 r4
 @end lilypond
 
-The combination of a metronome marking and textual description
-will automatically place the metronome marking within parentheses:
+Combining a metronome mark and text will automatically place the
+metronome mark within parentheses:
 
 @lilypond[verbatim,quote,relative=2]
 \tempo "Allegro" 4 = 160
 g4 c d e
+d4 b g2
 @end lilypond
 
-To write a metronome marking in parentheses without the text,
-include an empty string in the input:
+In general, the text can be any markup object:
+
+@lilypond[verbatim,quote,relative=2]
+\tempo \markup { \italic Faster } 4 = 132
+a8-. r8 b-. r gis-. r a-. r
+@end lilypond
+
+A parenthesized metronome mark with no textual indication may be
+written by including an empty string in the input:
 
 @lilypond[verbatim,quote,relative=2]
 \tempo "" 8 = 96
@@ -911,9 +935,9 @@ of @code{shortInstrumentName} is used for all succeeding staves.
 @lilypond[verbatim,quote,ragged-right,relative=1]
 \set Staff.instrumentName = "Violin "
 \set Staff.shortInstrumentName = "Vln "
-c1
+c4.. g'16 c4.. g'16
 \break
-c''1
+c1
 @end lilypond
 
 Markup mode can be used to create more complicated instrument
@@ -923,7 +947,7 @@ names:
 \set Staff.instrumentName = \markup {
   \column { "Clarinetti"
             \line { "in B" \smaller \flat } } }
-c1
+c4 c,16 d e f g2
 @end lilypond
 
 @cindex instrument names, centering
@@ -935,16 +959,16 @@ default.  To center multi-line instrument names,
 
 @lilypond[verbatim,quote,relative=2]
 <<
+  \new Staff {
+    \set Staff.instrumentName = "Flute"
+    f2 g4 f
+  }
   \new Staff {
     \set Staff.instrumentName = \markup \center-column {
       Clarinetti
       \line { "in B" \smaller \flat }
     }
-    c1
-  }
-  \new Staff {
-    \set Staff.instrumentName = "Vibraphone"
-    c1
+    c4 b c2
   }
 >>
 @end lilypond
@@ -952,28 +976,33 @@ default.  To center multi-line instrument names,
 @cindex indent
 @cindex short-indent
 
-The @code{indent} and @code{short-indent} settings specify the
-level of indentation for the first system and all succeeding
-systems, respectively.  They can be modified in the @code{\layout}
-block.  For longer instrument names or short instrument names, it
-may be useful to increase the @code{indent} and
-@code{short-indent} settings:
-
-@lilypond[verbatim,quote]
-\relative c' <<
-  \new Staff \with {
-    instrumentName = "Oboe"
-  }
-  { c2 d }
-  \new Staff \with {
-    instrumentName = "Glockenspiel"
-  }
-  { c'2 d }
->>
+However, if the instrument names are longer, the instrument names
+in a staff group may not be centered unless the @code{indent} and
+@code{short-indent} settings are increased.  The @code{indent} and
+@code{short-indent} settings are modified in the @code{\layout}
+block and specify the level of indentation for the first system
+and all succeeding systems, respectively.
 
+@lilypond[verbatim,quote,ragged-right]
 \layout {
   indent = 2.5\cm
+  short-indent = 1.5\cm
 }
+
+\relative c'' <<
+  \new Staff {
+    \set Staff.instrumentName = "Flute"
+    \set Staff.shortInstrumentName = "Fl."
+    f2 g4 f \break
+    g4 f g2
+  }
+  \new Staff {
+    \set Staff.instrumentName = "Clarinet"
+    \set Staff.shortInstrumentName = "Clar."
+    c,4 b c2 \break
+    c2 b4 c
+  }
+>>
 @end lilypond
 
 To add instrument names to other contexts (such as
@@ -997,12 +1026,6 @@ c1 c c c \break
 @end lilypond
 
 
-@snippets
-
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
-{aligning-and-centering-instrument-names.ly}
-
-
 @seealso
 
 Notation Reference:
@@ -1166,8 +1189,8 @@ into a @code{CueVoice} context.  The @code{CueVoice} is created
 implicitly, and occurs simultaneously with @var{music}, which
 creates a polyphonic situation.  The @var{voice} argument
 determines whether the cue notes should be notated as a first or
-second voice; @code{DOWN} corresponds to the first voice, and
-@code{UP} corresponds to the second.
+second voice; @code{UP} corresponds to the first voice, and
+@code{DOWN} corresponds to the second.
 
 @lilypond[verbatim,quote]
 oboe = \relative c'' {
@@ -1186,8 +1209,42 @@ In the above example, the @code{Voice} context had to be
 explicitly declared, or else the entire music expression would
 belong to the @code{CueVoice} context.
 
-@c TODO document \killCues
-@c TODO document instrumentCueName context property
+The name of the cued instrument can be printed by setting the
+@code{instrumentCueName} property.
+
+@lilypond[verbatim,quote]
+oboe = \relative c''' {
+  g4 r8 e16 f e4 d
+}
+\addQuote oboe { \oboe }
+
+\new Staff \relative c'' <<
+  \new CueVoice \with {
+    instrumentCueName = "ob."
+  }
+  \new Voice {
+    \cueDuring #"oboe" #UP { R1 }
+    g4. b8 d2
+  }
+>>
+@end lilypond
+
+The @code{\killCues} command is used to remove the cue notes from
+a music expression.
+
+@lilypond[verbatim,quote]
+flute = \relative c''' {
+  r2 cis2 r2 dis2
+}
+\addQuote flute { \flute }
+
+\new Voice \relative c'' {
+  \killCues {
+    \cueDuring #"flute" #UP { R1 }
+    g4. b8 d2
+  }
+}
+@end lilypond
 
 When typesetting cue notes, some guidelines should be followed:
 
@@ -1208,8 +1265,11 @@ clef, the original clef should be stated once again.
 @end itemize
 
 The @code{\transposedCueDuring} command is useful to add cues for
-instruments in a completely different register.  Having piccolo
-cues within a contrabassoon part is a good example.
+instruments in a completely different register.  The syntax is
+similar to @code{\cueDuring}, but it requires one more argument to
+specify the transposition of the cued instrument.  For more
+information about transposition, see
+@ref{Instrument transpositions}.
 
 @lilypond[verbatim,quote]
 piccolo = \relative c''' {
@@ -1236,10 +1296,14 @@ cbassoon = \relative c, {
 
 @seealso
 
+Notation Reference:
+@ref{Instrument transpositions}.
+
 Snippets:
 @rlsr{Staff notation}.
 
 Internals Reference:
+@rinternals{CueVoice},
 @rinternals{Voice}.