]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/keyboards.itely
Doc: CSS: A better brown for the usage manual
[lilypond.git] / Documentation / notation / keyboards.itely
index d073804d2b7ec537e013bef59422e6134f99cc31..db8057b67f97687824f8cf4d272fe8c7d4dea890 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.12.0"
+@c \version "2.19.25"
 
 @node Keyboard and other multi-staff instruments
 @section Keyboard and other multi-staff instruments
@@ -51,6 +51,10 @@ keyboard instruments.
 @cindex staves, keyed instruments
 @cindex keyboard instrument staves
 @cindex keyed instrument staves
+@cindex keyboard music, centering dynamics
+@cindex dynamics, centered in keyboard music
+@cindex piano music, centering dynamics
+@cindex centered dynamics in piano music
 
 @funindex PianoStaff
 
@@ -76,6 +80,11 @@ number of voices may change regularly; this is described in
 @item Keyboard music can be written in parallel, as described in
 @ref{Writing music in parallel}.
 
+@item Dynamics may be placed in a @code{Dynamics} context,
+between the two @code{Staff} contexts
+to align the dynamic marks on a horizontal line
+centered between the staves; see @ref{Dynamics}.
+
 @item Fingerings are indicated with @ref{Fingering instructions}.
 
 @item Organ pedal indications are inserted as articulations, see
@@ -101,9 +110,9 @@ as shown in @rlearning{Other uses for tweaks}.
 @end itemize
 
 @c @snippets
-@c @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@c @lilypondfile[verbatim,quote,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
+@c http://lsr.di.unimi.it/LSR/Item?u=1&id=312
 
 @seealso
 Learning Manual:
@@ -129,20 +138,6 @@ 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
-@code{staff-padding} of dynamics as discussed in @rlearning{Moving
-objects}.
-
 @node Changing staff manually
 @unnumberedsubsubsec Changing staff manually
 
@@ -155,7 +150,6 @@ objects}.
 @cindex beams, cross-staff
 
 @funindex \change
-@funindex change
 
 Voices can be switched between staves manually, using the command
 
@@ -201,6 +195,42 @@ center of the staff that is closest to the beam.  For a simple
 example of beam tweaking, see @rlearning{Fixing overlapping
 notation}.
 
+@cindex cross-staff collisions
+@cindex collisions, cross-staff voices
+
+Overlapping notation can result when voices cross staves:
+
+@lilypond[verbatim,quote]
+\new PianoStaff <<
+  \new Staff = "up" {
+    \voiceOne
+    % Make space for fingering in the cross-staff voice
+    \once\override DynamicLineSpanner.staff-padding = #4
+    e''2\p\< d''\>
+    c''1\!
+  }
+  \new Staff = "down" <<
+    {
+      \clef bass
+      s4. e,8\rest g,2\rest
+      c1
+    } \\ {
+      c8\( g c'
+      \change Staff = "up"
+      e' g' b'-3 a' g'\)
+      f'1
+    }
+  >>
+>>
+@end lilypond
+
+The stem and slur overlap the intervening line of dynamics
+because automatic collision resolution is suspended for beams, slurs
+and other spanners that connect notes on different staves,
+as well as for stems and articulations if their placement is
+affected by a cross-staff spanner.
+The resulting collisions must be resolved manually, where necessary,
+using the methods in @rlearning{Fixing overlapping notation}.
 
 @seealso
 Learning Manual:
@@ -218,6 +248,10 @@ Internals Reference:
 @rinternals{Beam},
 @rinternals{ContextChange}.
 
+@knownissues
+Beam collision avoidance does not work for automatic beams that end
+right before a change in staff.  In this case use manual beams.
+
 
 @node Changing staff automatically
 @unnumberedsubsubsec Changing staff automatically
@@ -227,7 +261,6 @@ Internals Reference:
 @cindex staff changes, automatic
 
 @funindex \autochange
-@funindex autochange
 @funindex PianoStaff
 
 Voices can be made to switch automatically between the top and the
@@ -254,11 +287,25 @@ in advance.
 }
 @end lilypond
 
+@noindent
+It is possible to specify other pitches for the turning point.
+If the staves are not instantiated explicitly, other clefs may be used.
+
+@lilypond[quote,verbatim]
+music = {
+  g8 b a c' b8 d' c'8 e'
+  d'8 r f' g' a'2
+}
+
+\autochange d' \music
+\autochange b \with { \clef soprano } \music
+\autochange d' \with { \clef alto } \with { \clef tenor } \music
+@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
@@ -280,7 +327,7 @@ key signature in the lower staff:
   \new Staff = "up" {
     \new Voice = "melOne" {
       \key g \major
-      \autochange \relative c' {
+      \autochange \relative {
         g8 b a c b d c e
         d8 r fis, g a2
       }
@@ -293,7 +340,6 @@ key signature in the lower staff:
 >>
 @end lilypond
 
-
 @seealso
 Notation Reference:
 @ref{Changing staff manually}.
@@ -306,7 +352,6 @@ Internals Reference:
 
 
 @knownissues
-
 @cindex chords, splitting across staves with \autochange
 
 The staff switches may not end up in optimal places.  For high
@@ -315,6 +360,7 @@ quality output, staff switches should be specified manually.
 Chords will not be split across the staves; they will be assigned to a
 staff based on the first note named in the chord construct.
 
+
 @node Staff-change lines
 @unnumberedsubsubsec Staff-change lines
 
@@ -332,18 +378,16 @@ staff based on the first note named in the chord construct.
 
 @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,verbatim,relative=1]
+@lilypond[quote,verbatim]
 \new PianoStaff <<
   \new Staff = "one" {
     \showStaffSwitch
-    c1
+    c'1
     \change Staff = "two"
     b2 a
   }
@@ -360,7 +404,6 @@ notes can be printed automatically:
 @code{\hideStaffSwitch}.
 @endpredefined
 
-
 @seealso
 Snippets:
 @rlsr{Keyboards}.
@@ -384,46 +427,26 @@ Internals Reference:
 @cindex cross staff chords
 
 @funindex Stem
-@funindex cross-staff
-@funindex length
-@funindex flag-style
+@funindex \crossStaff
+@funindex \autoBeamOff
+@funindex Span_stem_engraver
 
-Chords that cross staves may be produced:
+Chords that cross staves may be produced using the
+@code{Span_stem_engraver}. Care must be taken to ensure that
+automatic beams do not beam the notes on one staff when it’s not
+required on the other.
 
-@lilypond[verbatim,quote]
-\new PianoStaff <<
-  \new Staff {
-    \relative c' {
-      f8 e4 d8 d f e4
-    }
-  }
-  \new Staff {
-    \relative c' {
-      << {
-        \clef bass
-        % stems may overlap the other staff
-        \override Stem #'cross-staff = ##t
-        % extend the stems to reach the 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
+@lilypondfile[verbatim,quote]
+{cross-staff-stems.ly}
+
+For the time being, this engraver can not be specified by its name in
+double quotes, but rather prefixing its name with a hash symbol
+@code{#}, due to the way it is implemented.
 
 @snippets
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+@lilypondfile[verbatim,quote,texidoc,doctitle]
 {indicating-cross-staff-chords-with-arpeggio-bracket.ly}
 
-
 @seealso
 Snippets:
 @rlsr{Keyboards}.
@@ -457,30 +480,26 @@ piano.
 @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 corda} (@notation{U.C.}).
 Sustain pedals are also found on vibraphones and celestas.
 
-@lilypond[quote,verbatim,relative=2]
-c4\sustainOn d e g
-<c, f a>1\sustainOff
-c4\sostenutoOn e g c,
-<bes d f>1\sostenutoOff
-c4\unaCorda d e g
-<d fis a>1\treCorde
+@lilypond[quote,verbatim]
+\relative {
+  c''4\sustainOn d e g
+  <c, f a>1\sustainOff
+  c4\sostenutoOn e g c,
+  <bes d f>1\sostenutoOff
+  c4\unaCorda d e g
+  <d fis a>1\treCorde
+}
 @end lilypond
 
 @cindex pedal indication styles
@@ -499,21 +518,25 @@ 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,verbatim,relative=2]
-c4\sustainOn g c2\sustainOff
-\set Staff.pedalSustainStyle = #'mixed
-c4\sustainOn g c d
-d\sustainOff\sustainOn g, c2\sustainOff
-\set Staff.pedalSustainStyle = #'bracket
-c4\sustainOn g c d
-d\sustainOff\sustainOn g, c2
-\bar "|."
+@lilypond[quote,verbatim]
+\relative {
+  c''4\sustainOn g c2\sustainOff
+  \set Staff.pedalSustainStyle = #'mixed
+  c4\sustainOn g c d
+  d\sustainOff\sustainOn g, c2\sustainOff
+  \set Staff.pedalSustainStyle = #'bracket
+  c4\sustainOn g c d
+  d\sustainOff\sustainOn g, c2
+  \bar "|."
+}
 @end lilypond
 
 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 off command.
 
+Pedal indications may be placed in a @code{Dynamics} context,
+which aligns them on a horizontal line.
 
 @seealso
 Notation Reference:
@@ -564,9 +587,8 @@ come into use to simplify the performance instructions.
 
 @snippets
 
-@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
-{accordion-discant-symbols.ly}
-
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{accordion-register-symbols.ly}
 
 @seealso
 Snippets:
@@ -611,6 +633,7 @@ Notation Reference:
 @ref{Arpeggio},
 @ref{Harmonics}.
 
+
 @node Harp pedals
 @unnumberedsubsubsec Harp pedals
 
@@ -626,20 +649,20 @@ 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]
+@lilypond[quote,verbatim,fragment]
 \textLengthOn
-cis1_\markup \concat \vcenter {
+cis''1_\markup \concat \vcenter {
   [D \flat C \sharp B|E \sharp F \sharp G A \flat] }
-c!1_\markup \concat \vcenter {
+c''!1_\markup \concat \vcenter {
   [ C \natural ] }
 @end lilypond
 
 or pedal diagrams:
 
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
 \textLengthOn
-cis1_\markup { \harp-pedal #"^v-|vv-^" }
-c!1_\markup { \harp-pedal #"^o--|vv-^" }
+cis''1_\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