]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/keyboards.itely
lilypond-book robustness: ensure EOL at the end of @verbatim
[lilypond.git] / Documentation / user / keyboards.itely
index 680d639d0ea97e7071643c25bd5e1fc380309d61..c1adb583b674c4bfbd1483957e51aeb3634b27fb 100644 (file)
@@ -6,27 +6,32 @@
     version that you are working on.  See TRANSLATION for details.
 @end ignore
 
-@c \version "2.11.51"
+@c \version "2.12.0"
 
-@node Keyboard instruments
-@section Keyboard instruments
+@node Keyboard and other multi-staff instruments
+@section Keyboard and other multi-staff instruments
 
 @lilypondfile[quote]{keyboard-headword.ly}
 
-This section discusses several aspects of music notation that are unique
-to keyboard instruments.
+This section discusses several aspects of music notation that are
+unique to keyboard instruments and other instruments notated on
+many staves, such as harps and vibraphones.  For the purposes of
+this section this entire group of multi-staff instruments is called
+@qq{keyboards} for short, even though some of them do not have a
+keyboard.
 
 @menu
 * Common notation for keyboards::
 * Piano::
 * Accordion::
+* Harp::
 @end menu
 
 @node Common notation for keyboards
 @subsection Common notation for keyboards
 
-This section discusses notation issues that may arise for most keyboard
-instruments.
+This section discusses notation issues that may arise for most
+keyboard instruments.
 
 @menu
 * References for keyboards::
@@ -39,20 +44,30 @@ instruments.
 @node References for keyboards
 @unnumberedsubsubsec References for keyboards
 
+@cindex piano staves
+@cindex staves, piano
+@cindex staves, keyboard instruments
+@cindex staves, keyed instruments
+@cindex keyboard instrument staves
+@cindex keyed instrument staves
+
+@funindex PianoStaff
+
 Keyboard instruments are usually notated with Piano staves.  These
 are two or more normal staves coupled with a brace.  The same
-notation is also used for harps and other keyed instruments.
+notation is also used for other keyed instruments.
 Organ music is normally written with two staves inside a
 @code{PianoStaff} group and third, normal staff for the pedals.
 
 The staves in keyboard music are largely independent, but
-sometimes voices can cross between the two staves.  In this
-section we discuss some notation techniques particular to keyboard
+sometimes voices can cross between the two staves.  This
+section discusses notation techniques particular to keyboard
 music.
 
 Several common issues in keyboard music are covered elsewhere:
 
 @itemize
+
 @item Keyboard music usually contains multiple voices and the
 number of voices may change regularly; this is described in
 @ref{Collision resolution}.
@@ -84,8 +99,12 @@ as shown in @rlearning{Other uses for tweaks}.
 
 @end itemize
 
-@seealso
+@c @snippets
+@c @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@c {forcing-visibility-of-systems-with-multi-bar-rests-when-using-\RemoveEmptyStaffContext.ly}
+@c http://lsr.dsi.unimi.it/LSR/Item?u=1&id=312
 
+@seealso
 Learning Manual:
 @rlearning{Real music example},
 @rlearning{Other uses for tweaks}.
@@ -93,13 +112,14 @@ Learning Manual:
 Notation Reference:
 @ref{Grouping staves},
 @ref{Instrument names},
+@ref{Collision resolution},
 @ref{Writing music in parallel},
 @ref{Fingering instructions},
+@ref{List of articulations},
 @ref{Grid lines},
 @ref{Ties},
 @ref{Arpeggio},
-@ref{Tremolo repeats},
-@ref{List of articulations}.
+@ref{Tremolo repeats}.
 
 Internals Reference:
 @rinternals{PianoStaff}.
@@ -107,8 +127,15 @@ Internals Reference:
 Snippets:
 @rlsr{Keyboards}.
 
+
 @knownissues
 
+@cindex keyboard music, centering dynamics
+@cindex dynamics, centered in keyboard music
+@cindex piano music, centering dynamics
+@cindex centered dynamics in piano music
+@funindex staff-padding
+
 Dynamics are not automatically centered, but workarounds do exist.  One
 option is the @q{piano centered dynamics} template under
 @rlearning{Piano templates}; another option is to increase the
@@ -125,7 +152,9 @@ objects}.
 @cindex notes, cross-staff
 @cindex cross-staff beams
 @cindex beams, cross-staff
+
 @funindex \change
+@funindex change
 
 Voices can be switched between staves manually, using the command
 
@@ -135,27 +164,32 @@ Voices can be switched between staves manually, using the command
 
 @noindent
 The string @var{staffname} is the name of the staff.  It switches
-the current voice from its current staff to the Staff called
+the current voice from its current staff to the staff called
 @var{staffname}.  Typical values for @var{staffname} are
 @code{"up"} and @code{"down"}, or @code{"RH"} and @code{"LH"}.
 
+The staff to which the voice is being switched must exist at the
+time of the switch.  If necessary, staves should be @qq{kept alive},
+see @ref{Keeping contexts alive}.
+
 Cross-staff notes are beamed automatically:
 
-@lilypond[verbatim,quote,ragged-right]
+@lilypond[verbatim,quote]
 \new PianoStaff <<
   \new Staff = "up" {
     <e' c'>8
-    \change Staff = down
-    g fis g
-    \change Staff = up
+    \change Staff = "down"
+    g8 fis g
+    \change Staff = "up"
     <g'' c''>8
-    \change Staff = down
-    e dis e
-    \change Staff = up
+    \change Staff = "down"
+    e8 dis e
+    \change Staff = "up"
   }
   \new Staff = "down" {
     \clef bass
-    s1 % keep staff alive
+    % keep staff alive
+    s1
   }
 >>
 @end lilypond
@@ -166,20 +200,22 @@ center of the staff that is closest to the beam.  For a simple
 example of beam tweaking, see @rlearning{Fixing overlapping
 notation}.
 
-@seealso
 
+@seealso
 Learning Manual:
 @rlearning{Fixing overlapping notation}.
 
 Notation Reference:
-@ruser{Stems},
-@ruser{Automatic beams}.
+@ref{Stems},
+@ref{Automatic beams},
+@ref{Keeping contexts alive}.
 
 Snippets:
 @rlsr{Keyboards}.
 
 Internals Reference:
-@rinternals{Beam}.
+@rinternals{Beam},
+@rinternals{ContextChange}.
 
 
 @node Changing staff automatically
@@ -188,7 +224,10 @@ Internals Reference:
 @cindex changing staff automatically
 @cindex automatic staff changes
 @cindex staff changes, automatic
+
 @funindex \autochange
+@funindex autochange
+@funindex PianoStaff
 
 Voices can be made to switch automatically between the top and the
 bottom staff.  The syntax for this is
@@ -200,19 +239,26 @@ bottom staff.  The syntax for this is
 @noindent
 This will create two staves inside the current staff group
 (usually a @code{PianoStaff}), called @code{"up"} and
-@code{"down"}.  The lower staff will be in bass clef by default.
-The autochanger switches on basis of the pitch (middle C is the
+@code{"down"}.  The lower staff will be in the bass clef by default.
+The autochanger switches on the basis of the pitch (middle@tie{}C is the
 turning point), and it looks ahead skipping over rests to switch
 in advance.
 
-@lilypond[quote,verbatim,ragged-right]
+@lilypond[quote,verbatim]
 \new PianoStaff {
   \autochange {
-    g4 a b c' d' r4 a g
+    g4 a b c'
+    d'4 r a g
   }
 }
 @end lilypond
 
+@cindex relative music and autochange
+@cindex autochange and relative music
+
+@funindex \relative
+@funindex relative
+
 A @code{\relative} section that is outside of @code{\autochange}
 has no effect on the pitches of the music, so if necessary, put
 @code{\relative} inside @code{\autochange}.
@@ -220,17 +266,22 @@ has no effect on the pitches of the music, so if necessary, put
 If additional control is needed over the individual staves, they
 can be created manually with the names @code{"up"} and
 @code{"down"}.  The @code{\autochange} command will then switch
-its voice between the existing staves.  For example, this is
-necessary to place a key signature in the lower staff:
+its voice between the existing staves.  
 
-@lilypond[quote,verbatim,ragged-right]
+@warning{If staves are created manually, they @emph{must} be named
+@code{"up"} and @code{"down"}.}
+
+For example, staves must be created manually in order to place a
+key signature in the lower staff:
+
+@lilypond[quote,verbatim]
 \new PianoStaff <<
   \new Staff = "up" {
     \new Voice = "melOne" {
       \key g \major
       \autochange \relative c' {
         g8 b a c b d c e
-        d r fis, g a2
+        d8 r fis, g a2
       }
     }
   }
@@ -241,8 +292,8 @@ necessary to place a key signature in the lower staff:
 >>
 @end lilypond
 
-@seealso
 
+@seealso
 Notation Reference:
 @ref{Changing staff manually}.
 
@@ -252,8 +303,11 @@ Snippets:
 Internals Reference:
 @rinternals{AutoChangeMusic}.
 
+
 @knownissues
 
+@cindex chords, splitting across staves with \autochange
+
 The staff switches may not end up in optimal places.  For high
 quality output, staff switches should be specified manually.
 
@@ -263,41 +317,55 @@ staff based on the first note named in the chord construct.
 @node Staff-change lines
 @unnumberedsubsubsec Staff-change lines
 
-@cindex staff-change lines
-@cindex cross-staff lines
-@cindex lines, staff-change follower
+@cindex staff-change line
+@cindex staff change line
+@cindex cross-staff line
+@cindex cross staff line
+@cindex line, staff-change follower
+@cindex line, cross-staff
+@cindex line, staff-change
 @cindex follow voice
+@cindex voice, following
 @cindex staff switching
 @cindex cross-staff
+
 @funindex followVoice
+@funindex \showStaffSwitch
+@funindex showStaffSwitch
+@funindex \hideStaffSwitch
+@funindex hideStaffSwitch
 
 Whenever a voice switches to another staff, a line connecting the
 notes can be printed automatically:
 
-@lilypond[quote,ragged-right,fragment,relative=1,verbatim]
+@lilypond[quote,verbatim,relative=1]
 \new PianoStaff <<
   \new Staff = "one" {
     \showStaffSwitch
     c1
-    \change Staff=two
+    \change Staff = "two"
     b2 a
   }
-  \new Staff = "two" { \clef bass s1*2 }
+  \new Staff = "two" {
+    \clef bass
+    s1*2
+  }
 >>
 @end lilypond
 
+
 @predefined
+@code{\showStaffSwitch},
+@code{\hideStaffSwitch}.
+@endpredefined
 
-@funindex \showStaffSwitch
-@funindex \hideStaffSwitch
-@code{\showStaffSwitch}, @code{\hideStaffSwitch}.
 
 @seealso
-
 Snippets:
 @rlsr{Keyboards}.
 
 Internals Reference:
+@rinternals{Note_head_line_engraver},
 @rinternals{VoiceFollower}.
 
 
@@ -305,45 +373,63 @@ Internals Reference:
 @unnumberedsubsubsec Cross-staff stems
 
 @cindex cross-staff notes
+@cindex cross staff notes
 @cindex notes, cross-staff
 @cindex cross-staff stems
+@cindex cross staff stems
 @cindex stems, cross-staff
+@cindex chords, cross-staff
+@cindex cross-staff chords
+@cindex cross staff chords
+
+@funindex Stem
+@funindex cross-staff
+@funindex length
+@funindex flag-style
 
-Chords that cross staves may be produced by increasing the length
-of the stem in the lower staff, so it reaches the stem in the upper
-staff, or vice versa.
+Chords that cross staves may be produced:
 
-@lilypond[ragged-right,verbatim,quote]
+@lilypond[verbatim,quote]
 \new PianoStaff <<
-  \new Staff \relative c' {
-    f8 e4 d8 <f bes,>2
+  \new Staff {
+    \relative c' {
+      f8 e4 d8 d f e4
+    }
   }
-  \new Staff \relative c' {
-    << {
-      \clef bass
-      \stemUp
-      \override Stem #'length = #12
-      \override Stem #'cross-staff = ##t
-      \override Stem #'flag-style = #'no-flag
-      a8 g4 f8
-    } \\
-    { f,2 d' }
-    >>
+  \new Staff {
+    \relative c' {
+      << {
+        \clef bass
+        % stems may overlap the other staff
+        \override Stem #'cross-staff = ##t
+        % extend the stems to reach other other staff
+        \override Stem #'length = #12
+        % do not print extra flags
+        \override Stem #'flag-style = #'no-flag
+        % prevent beaming as needed
+        a8 g4 f8 f bes\noBeam g4
+      }
+      \\
+      {
+        f,2 bes4 c
+      } >>
+    }
   }
 >>
 @end lilypond
 
 @snippets
-@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {indicating-cross-staff-chords-with-arpeggio-bracket.ly}
 
-@seealso
 
+@seealso
 Snippets:
 @rlsr{Keyboards}.
 
 Internals Reference:
-@rinternals{Stem}
+@rinternals{Stem}.
+
 
 @node Piano
 @subsection Piano
@@ -357,25 +443,37 @@ piano.
 
 @node Piano pedals
 @unnumberedsubsubsec Piano pedals
+
 @cindex piano pedals
 @cindex pedals, piano
 @cindex sustain pedal
+@cindex pedal, sustain
 @cindex sostenuto pedal
-@cindex una corde
+@cindex pedal, sostenuto
+@cindex una corda
 @cindex tre corde
+@cindex sos.
+@cindex U.C.
+
 @funindex \sustainOn
+@funindex sustainOn
 @funindex \sustainOff
+@funindex sustainOff
 @funindex \sostenutoOn
+@funindex sostenutoOn
 @funindex \sostenutoOff
+@funindex sostenutoOff
 @funindex \unaCorda
+@funindex unaCorda
 @funindex \treCorde
+@funindex treCorde
 
 Pianos generally have three pedals that alter the way sound is
 produced: @notation{sustain}, @notation{sostenuto}
-(@notation{sos.}), and @notation{una corde} (@notation{U.C.}).
+(@notation{sos.}), and @notation{una corda} (@notation{U.C.}).
 Sustain pedals are also found on vibraphones and celestas.
 
-@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
+@lilypond[quote,verbatim,relative=2]
 c4\sustainOn d e g
 <c, f a>1\sustainOff
 c4\sostenutoOn e g c,
@@ -384,11 +482,23 @@ c4\unaCorda d e g
 <d fis a>1\treCorde
 @end lilypond
 
+@cindex pedal indication styles
+@cindex pedal indication, text
+@cindex pedal indication, bracket
+@cindex pedal indication, mixed
+@cindex pedal sustain style
+@cindex sustain pedal style
+
+@funindex pedalSustainStyle
+@funindex mixed
+@funindex bracket
+@funindex text
+
 There are three styles of pedal indications: text, bracket, and mixed.
 The sustain pedal and the una corda pedal use the text style by default
 while the sostenuto pedal uses mixed by default.
 
-@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
+@lilypond[quote,verbatim,relative=2]
 c4\sustainOn g c2\sustainOff
 \set Staff.pedalSustainStyle = #'mixed
 c4\sustainOn g c d
@@ -401,10 +511,10 @@ d\sustainOff\sustainOn g, c2
 
 The placement of the pedal commands matches the physical movement of the
 sustain pedal during piano performance.  Pedalling to the final bar line
-is indicated by omitting the final pedal up command.
+is indicated by omitting the final pedal off command.
 
-@seealso
 
+@seealso
 Notation Reference:
 @ref{Ties}.
 
@@ -414,16 +524,22 @@ Snippets:
 Internals Reference:
 @rinternals{SustainPedal},
 @rinternals{SustainPedalLineSpanner},
+@rinternals{SustainEvent},
 @rinternals{SostenutoPedal},
 @rinternals{SostenutoPedalLineSpanner},
+@rinternals{SostenutoEvent},
 @rinternals{UnaCordaPedal},
 @rinternals{UnaCordaPedalLineSpanner},
+@rinternals{UnaCordaEvent},
 @rinternals{PianoPedalBracket},
 @rinternals{Piano_pedal_engraver}.
 
+
 @node Accordion
 @subsection Accordion
 
+@cindex accordion
+
 This section discusses notation that is unique to the accordion.
 
 @menu
@@ -432,9 +548,11 @@ This section discusses notation that is unique to the accordion.
 
 @node Discant symbols
 @unnumberedsubsubsec Discant symbols
+
 @cindex accordion discant symbols
 @cindex discant symbols, accordion
 @cindex accordion shifts
+@cindex accordion shift symbols
 
 Accordions are often built with more than one set of reeds that may be
 in unison with, an octave above, or an octave below the written pitch.
@@ -445,10 +563,89 @@ come into use to simplify the performance instructions.
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
 {accordion-discant-symbols.ly}
 
-@seealso
 
+@seealso
 Snippets:
 @rlsr{Keyboards}.
+
+
+@node Harp
+@subsection Harp
+
+This section discusses notation issues that are unique to the harp.
+
+@menu
+* References for harps::
+* Harp pedals::
+@end menu
+
+@node References for harps
+@unnumberedsubsubsec References for harps
+@cindex harps
+@cindex bisbiglando
+
+Some common characteristics of harp music are covered elsewhere:
+
+@itemize
+
+@item The glissando is the most characterisic harp technique,
+@ref{Glissando}.
+
+@item A @notation{bisbigliando} is written as a tremelo @ref{Tremolo
+repeats}
+
+@item Natural harmonics are covered under @ref{Harmonics}.
+
+@item For directional arpeggios and non-arpeggios, see @ref{Arpeggio}.
+
+@end itemize
+
+@seealso
+Notation Reference:
+@ref{Tremolo repeats}
+@ref{Glissando}
+@ref{Arpeggio}
+@ref{Harmonics}
+
+@node Harp pedals
+@unnumberedsubsubsec Harp pedals
+
+@cindex harp pedals
+@cindex harp pedal diagrams
+@cindex pedals, harp
+@cindex pedal diagrams, harp
+
+Harps have seven strings per octave that may be sounded at the natural,
+flattened, or sharpened pitch. In lever harps, each string is adjusted
+individually, but in pedal harps every string with the same pitch name
+is controlled by a single pedal. From the player's left to right, the
+pedals are D, C, and B on the left and E, F, G, and A on the right.
+The position of the pedals may be indicated with text marks:
+
+@lilypond[quote,verbatim,relative=2]
+\textLengthOn
+cis1_\markup \concat \vcenter { [D \flat C \sharp B|E \sharp F \sharp G A \flat] }
+c!1_\markup \concat \vcenter {[ C \natural ]}
+@end lilypond
+
+or pedal diagrams:
+
+@lilypond[quote,verbatim,relative=2]
+\textLengthOn
+cis1_\markup { \harp-pedal #"^v-|vv-^" }
+c!1_\markup { \harp-pedal #"^o--|vv-^" }
+@end lilypond
+
+The @code{\harp-pedal} command accepts a string of characters, where
+@code{^} is the highest pedal position (flattened pitch), @code{-} is
+the middle pedal postion (natural pitch), @code{v} is the lowest pedal
+position (sharpened pitch), and @code{|} is the divider. A prefixed
+@code{o} will circle the following pedal symbol.
+
+@seealso
+Notation Reference:
+@ref{Text scripts}
+@ref{Instrument Specific Markup}