]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/learning/fundamental.itely
Fix typos in the English manual.
[lilypond.git] / Documentation / learning / fundamental.itely
index 14901a3b361b63b0d5d583c9b926820d3bf951ca..10d0d8f8bdb1f3deecbb8aacb9282b803024529b 100644 (file)
@@ -235,13 +235,13 @@ melody = \relative c' @{
 When LilyPond looks at this file, it takes the value of
 @code{melody} (everything after the equals sign) and inserts it
 whenever it sees @code{\melody}.  There's nothing special about
-the names -- it could be @code{melody}, @code{global},
-@code{keyTime}, @code{pianorighthand}, or @code{foofoobarbaz}.
-For more details, see @ref{Saving typing with variables and
-functions}.  Remember that you can use almost any name you like as
-long as it contains just alphabetic characters and is distinct
-from LilyPond command names.  The exact limitations on variable
-names are detailed in @ruser{File structure}.
+the name -- it could be @code{melody}, @code{global},
+@code{keyTime}, @code{pianorighthand}, or something else.
+Remember that you can use almost any name you like as long as it
+contains just alphabetic characters and is distinct from LilyPond
+command names.  For more details, see @ref{Saving typing with
+variables and functions}.  The exact limitations on variable names
+are detailed in @ruser{File structure}.
 
 
 @seealso
@@ -667,7 +667,7 @@ separately, like this:
 @cindex voices, naming
 @cindex voices crossing brackets
 @cindex slurs crossing brackets
-@cindex ties crossing brackest
+@cindex ties crossing brackets
 
 This example has just two voices, but the same construct may be
 used to encode three or more voices by adding more back-slash
@@ -1334,213 +1334,6 @@ VerseFour  =
 }
 @end lilypond
 
-@cindex verse and refrain
-
-We end with an example to show how we might code a solo verse which
-continues into a two-part refrain in two staves.  The positioning
-of the sequential and simultaneous sections to achieve this within
-a single score is quite tricky, so follow the explanation carefully!
-
-Let's start with a score block containing a @code{ChoirStaff}, as
-we would like the brace to appear at the start of the chorus.
-Normally you would need angle brackets after @code{\new ChoirStaff}
-to bring in all the staves in parallel, but here we want to
-defer the parallelism during the solo so we use braces, although
-angle brackets here wouldn't hurt.  Inside the @code{ChoirStaff} we
-want first the staff which will contain the verse.  This must
-contain notes and lyrics in parallel, so here we need angle
-brackets around the @code{\new Voice} and @code{\new Lyrics} to
-start them at the same time:
-
-@lilypond[quote,verbatim,ragged-right]
-versenotes = \relative c'' {
-  \clef "treble"
-  \key g \major
-  \time 3/4
-  g4 g g | b4 b b |
-}
-
-versewords = \lyricmode {
-  One two three | four five six |
-}
-
-\score {
-  \new ChoirStaff {
-    \new Staff <<
-      \new Voice = "verse" {
-        \versenotes \break
-      }
-      \new Lyrics \lyricsto verse {
-        \versewords
-      }
-    >>
-  }
-}
-@end lilypond
-
-That gives the verse line.
-
-Now we want to continue with refrainA on the same staff while a
-second staff is introduced in parallel with it for refrainB, so
-this is a parallel section which must be positioned immediately
-following the @code{\break} in the verse Voice.  Yes, @emph{within}
-the verse Voice!  Here's that parallel section.  More staves
-could be introduced here in the same way.
-
-@example
-<<
-  \refrainnotesA
-  \new Lyrics \lyricsto verse @{
-    \refrainwordsA
-  @}
-  \new Staff <<
-    \new Voice = "refrainB" @{
-      \refrainnotesB
-    @}
-    \new Lyrics \lyricsto "refrainB" @{
-      \refrainwordsB
-    @}
-  >>
->>
-@end example
-
-Here's the final result with two staves in the chorus showing
-how the parallel section is positioned within the verse Voice:
-
-@lilypond[quote,verbatim, ragged-right]
-versenotes = \relative c'' {
-  \clef "treble"
-  \key g \major
-  \time 3/4
-  g4 g g | b4 b b |
-}
-versewords = \lyricmode {
-  One two three | four five six |
-}
-refrainnotesA = \relative c'' {
-  \clef "treble"
-  \key g \major
-  \time 2/4
-  c4 c | g4 g | \bar "|."
-}
-refrainwordsA = \lyricmode {
-  la la | la la |
-}
-refrainnotesB = \relative c {
-  \clef "bass"
-  \key g \major
-  \time 2/4
-  c4 e | d4 d |
-}
-refrainwordsB = \lyricmode {
-  dum dum | dum dum |
-}
-
-\score {
-  \new ChoirStaff {
-    \new Staff <<
-      \new Voice = "verse" {
-        \versenotes \break
-        <<
-          \refrainnotesA
-          \new Lyrics \lyricsto "verse" {
-            \refrainwordsA
-          }
-          \new Staff <<
-            \new Voice = "refrainB" {
-              \refrainnotesB
-            }
-            \new Lyrics \lyricsto "refrainB" {
-              \refrainwordsB
-            }
-          >>
-        >>
-      }
-      \new Lyrics \lyricsto "verse" {
-        \versewords
-      }
-    >>
-  }
-}
-@end lilypond
-
-@cindex book, example of using
-@funindex \book
-@funindex book
-
-However, although this is an interesting and useful exercise to
-help you to understand how sequential and simultaneous blocks work,
-in practice one would perhaps choose to code this as two
-@code{\score} blocks within an implicit @code{\book} block, as
-follows:
-
-@lilypond[quote,verbatim,ragged-right]
-versenotes = \relative c'' {
-  \clef "treble"
-  \key g \major
-  \time 3/4
-  g4 g g | b4 b b |
-}
-
-versewords = \lyricmode {
-  One two three | four five six |
-}
-
-refrainnotesA = \relative c'' {
-  \clef "treble"
-  \key g \major
-  \time 2/4
-  c4 c | g4 g | \bar "|."
-}
-
-refrainwordsA = \lyricmode {
-  la la | la la |
-}
-
-refrainnotesB = \relative c {
-  \clef "bass"
-  \key g \major
-  \time 2/4
-  c4 e | d4 d |
-}
-
-refrainwordsB = \lyricmode {
-  dum dum | dum dum |
-}
-
-\score {
-  \new Staff <<
-    \new Voice = "verse" {
-      \versenotes
-    }
-    \new Lyrics \lyricsto "verse" {
-      \versewords
-    }
-  >>
-}
-
-\score {
-  \new ChoirStaff <<
-    \new Staff <<
-      \new Voice = "refrainA" {
-        \refrainnotesA
-      }
-      \new Lyrics \lyricsto "refrainA" {
-        \refrainwordsA
-      }
-    >>
-    \new Staff <<
-      \new Voice = "refrainB" {
-        \refrainnotesB
-      }
-      \new Lyrics \lyricsto "refrainB" {
-        \refrainwordsB
-      }
-    >>
-  >>
-}
-@end lilypond
-
 
 @seealso
 Notation Reference: @ruser{Vocal music}.
@@ -3026,6 +2819,79 @@ signature to each staff using our predefined variable, @code{\keyTime}.
 @}  % end Score context
 @end example
 
+@cindex stretchability of staves
+@cindex staves, stretchability
+
+The above layout of the organ staves is almost perfect; however,
+there is a slight defect which is not visible by looking at just a
+single system: The distance of the pedal staff to the left hand staff
+should behave approximately the same as the right hand staff to the
+left hand staff.  In particular, the stretchability of staves in a
+@code{PianoStaff} context is limited (so that the distance between
+the staves for the left and right hand can't become too large), and
+the pedal staff should behave similarly.
+
+@cindex sub-properties
+@cindex properties, sub-properties
+@cindex graphical objects
+@cindex objects, graphical
+@cindex grobs
+
+Stretchability of staves can be controlled with the
+@code{next-staff-spacing} property of the @code{VerticalAxisGroup}
+@q{graphical object} (commonly called @q{grob}s within the lilypond
+documentation) -- don't worry about the details right now; this is
+fully explained later.  For the curious, have a look at
+@ruser{Overview of modifying properties}.  Currently, it is not
+possible to modify the @code{stretchability} sub-property only, we
+thus have to copy the other sub-properties also.  Again, for the
+curious, you can find the default values in file
+@file{scm/@/define-grobs@/.scm} by looking up the definition of the
+@code{VerticalAxisGroup} grob.  The value for @code{stretchability}
+is taken from the definition of the @code{PianoStaff} context (in
+file @file{ly/@/engraver-init@/.ly}) so that the values are
+identical.
+
+@example
+\score @{
+  <<  % PianoStaff and Pedal Staff must be simultaneous
+    \new PianoStaff <<
+      \new Staff = "ManualOne" <<
+        \keyTime  % set key and time signature
+        \clef "treble"
+        \new Voice @{
+          \voiceOne
+          \ManualOneVoiceOneMusic
+        @}
+        \new Voice @{
+          \voiceTwo
+          \ManualOneVoiceTwoMusic
+        @}
+      >>  % end ManualOne Staff context
+      \new Staff = "ManualTwo" \with @{
+        \override VerticalAxisGroup
+          #'next-staff-spacing = #'((space . 9)
+                                    (minimum-distance . 8)
+                                    (padding . 1)
+                                    (stretchability . 5))
+      @} <<
+        \keyTime
+        \clef "bass"
+        \new Voice @{
+          \ManualTwoMusic
+        @}
+      >>  % end ManualTwo Staff context
+    >>  % end PianoStaff context
+    \new Staff = "PedalOrgan" <<
+      \keyTime
+      \clef "bass"
+      \new Voice @{
+        \PedalOrganMusic
+      @}
+    >>  % end PedalOrgan Staff
+  >>
+@}  % end Score context
+@end example
 That completes the structure.  Any three-staff organ music
 will have a similar structure, although the number of voices
 may vary.  All that remains now
@@ -3069,7 +2935,13 @@ PedalOrganMusic = \relative c {
           \ManualOneVoiceTwoMusic
         }
       >>  % end ManualOne Staff context
-      \new Staff = "ManualTwo" <<
+      \new Staff = "ManualTwo" \with {
+        \override VerticalAxisGroup
+          #'next-staff-spacing = #'((space . 9)
+                                    (minimum-distance . 8)
+                                    (padding . 1)
+                                    (stretchability . 5))
+      } <<
         \keyTime
         \clef "bass"
         \new Voice {