@menu
* How LilyPond files work::
-* Score is a single musical expression::
-* I'm seeing Voices::
-* Voices and vocals::
-* On the un-nestedness of brackets and ties::
+* Voices contain music::
+* TODO new sec fundamental::
@end menu
gloss over some details in favor of simplicity. For a complete
description of the input format, see @ruser{File structure}.
+@menu
+* Introduction to the LilyPond file structure::
+* Score is a single musical expression::
+@end menu
+
+@node Introduction to the LilyPond file structure
+@subsection Introduction to the LilyPond file structure
+
A basic example of a lilypond input file is
@example
@node Score is a single musical expression
-@section Score is a single musical expression
+@subsection Score is a single musical expression
We saw the general organization of LilyPond input files in the
previous section, @ref{How LilyPond files work}. But we seemed to
on the same horizontal position in your text editor.
+@node Voices contain music
+@section Voices contain music
+
+TODO: something cheesy and vaguely witty about voices being the
+fundamental thing that includes music in lilypond.
+
+@menu
+* I'm seeing Voices::
+* Explicitly instantiating voices::
+* Voices and vocals::
+@end menu
@c too cheesy? I'm not certain. -gp
@node I'm seeing Voices
-@section I'm seeing Voices
+@subsection I'm seeing Voices
@cindex polyphony
@code{noteA}.
+@node Explicitly instantiating voices
+@subsection Explicitly instantiating voices
+
+TODO: more colors and stuff.
+
+@internalsref{Voice} contexts can also be instantiated manually
+inside a @code{<< >>} block to create polyphonic music, using
+@code{\voiceOne}, up to @code{\voiceFour} to assign stem
+directions and a horizontal shift for each part.
+
+Specifically,
+@example
+<< \upper \\ \lower >>
+@end example
+
+@noindent
+is equivalent to
+
+@example
+<<
+ \new Voice = "1" @{ \voiceOne \upper @}
+ \new Voice = "2" @{ \voiceTwo \lower @}
+>>
+@end example
+
+The @code{\voiceXXX} commands set the direction of stems, slurs,
+ties, articulations, text annotations, augmentation dots of dotted
+notes, and fingerings. @code{\voiceOne} and @code{\voiceThree}
+make these objects point upwards, while @code{\voiceTwo} and
+@code{\voiceFour} make them point downwards. The command
+@code{\oneVoice} will revert back to the normal setting.
+
+An expression that appears directly inside a @code{<< >>} belongs
+to the main voice. This is useful when extra voices appear while
+the main voice is playing. Here is a more correct rendition of
+the example from the previous section. The crossed colored
+noteheads demonstrate that the main melody is now in a single
+voice context.
+
+@lilypond[quote,ragged-right,verbatim]
+\new Staff \relative c' {
+ \override NoteHead #'style = #'cross
+ \override NoteHead #'color = #red
+ c16 d e f
+ \voiceOne
+ <<
+ { g4 f e | d2 e2 }
+ \new Voice="1" { \voiceTwo
+ r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
+ \oneVoice
+ }
+ \new Voice { \voiceThree
+ s2. | s4 b4 c2
+ \oneVoice
+ }
+ >>
+ \oneVoice
+}
+@end lilypond
+
+The correct definition of the voices allows the melody to be
+slurred.
+
+@lilypond[quote,ragged-right,verbatim]
+\new Staff \relative c' {
+ c16^( d e f
+ \voiceOne
+ <<
+ { g4 f e | d2 e2) }
+ \context Voice="1" { \voiceTwo
+ r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
+ \oneVoice
+ }
+ \new Voice { \voiceThree
+ s2. s4 b4 c2
+ \oneVoice
+ }
+ >>
+ \oneVoice
+}
+@end lilypond
+
+Avoiding the @code{\\} separator also allows nesting polyphony
+constructs, which in some case might be a more natural way to
+typeset the music.
+
+@lilypond[quote,ragged-right,verbatim]
+\new Staff \relative c' {
+ c16^( d e f
+ \voiceOne
+ <<
+ { g4 f e | d2 e2) }
+ \context Voice="1" { \voiceTwo
+ r8 e4 d c8 ~ |
+ <<
+ {c8 b16 a b8 g ~ g2}
+ \new Voice { \voiceThree
+ s4 b4 c2
+ \oneVoice
+ }
+ >>
+ \oneVoice
+ }
+ >>
+ \oneVoice
+}
+@end lilypond
+
+
@node Voices and vocals
-@section Voices and vocals
+@subsection Voices and vocals
Vocal music presents a special difficulty: we need to combine two
expressions -- notes and lyrics.
TODO: get some vocal person to write more.
+@node TODO new sec fundamental
+@section TODO new sec fundamental
+
+blh blah
+
+
+@menu
+* On the un-nestedness of brackets and ties::
+@end menu
+
@c my name start sucking the more docs I write. -gp
@node On the un-nestedness of brackets and ties
-@section On the un-nestedness of brackets and ties
+@subsection On the un-nestedness of brackets and ties
Different kinds of brackets and ties may be mixed freely,
-
-
@node Writing repeats
@subsection Writing repeats
+Blah blah
+
@menu
-* Repeat types::
+* Normal repeats::
* Repeat syntax::
* Manual repeat commands::
* Repeats and MIDI::
@end menu
-@node Repeat types
-@unnumberedsubsubsec Repeat types
-
-@cindex repeats
-
-The following types of repetition are supported
-
-@table @code
-@item unfold
-Repeated music is fully written (played) out. This is useful when
-entering repetitious music. This is the only kind of repeat that
-is included in MIDI output.
-
-@item volta
-Repeats are not written out, but alternative endings (volte) are
-printed, left to right with brackets. This is the standard notation
-for repeats with alternatives. These are not played in MIDI output by
-default.
-
-
-@item tremolo
-Make tremolo beams. These are not played in MIDI output by default.
-
-@item percent
-Make beat or measure repeats. These look like percent signs. These
-are not played in MIDI output by default. Percent repeats must be
-declared within a @code{Voice} context.
-
-@end table
-
-
-@node Repeat syntax
-@unnumberedsubsubsec Repeat syntax
+@node Normal repeats
+@unnumberedsubsubsec Normal repeats
@cindex volta
@cindex prima volta
@cindex seconda volta
@funindex \repeat
-LilyPond has one syntactic construct for specifying different types of
-repeats. The syntax is
-
-@example
-\repeat @var{variant} @var{repeatcount} @var{repeatbody}
-@end example
-
-If you have alternative endings, you may add
-@funindex \alternative
-@example
-\alternative @{
- @var{alternative1}
- @var{alternative2}
- @var{alternative3}
- @dots{}
-@}
-@end example
-
-@noindent
-where each @var{alternative} is a music expression. If you do not
-give enough alternatives for all of the repeats, the first alternative
-is assumed to be played more than once.
-
-Standard repeats are used like this
+Normal repeats, with or without alternate repeats, may be printed:
@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
-c1
\repeat volta 2 { c4 d e f }
-\repeat volta 2 { f e d c }
-@end lilypond
-
-With alternative endings
-
-@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
+\repeat volta 2 { g f e d }
+ \alternative {
+ { cis2 g' }
+ { cis,2 b }
+ }
c1
-\repeat volta 2 {c4 d e f}
-\alternative { {d2 d} {f f,} }
@end lilypond
Repeats with upbeats may be created.
@end lilypond
-
@funindex \repeatTie
Ties may be added to a second ending,
If you want to start a repeat at the beginning of a line and have a
double bar at the end of the previous line, use
+
@example
@dots{} \bar "||:" \break
\repeat volta 2 @{ @dots{}
@end example
+
see @ref{Bar lines} for more information.
@seealso
Examples:
Brackets for the repeat are normally only printed over the topmost
-staff. This can be adjusted by moving @code{Volta_engraver} to the
-Staff context where you want the brackets to appear;
-see @ref{Modifying context plug-ins} and
-
+staff. This can be adjusted by moving @code{Volta_engraver} to
+the Staff context where you want the brackets to appear; see
+@ref{Modifying context plug-ins} and
@lsr{repeats,volta@/-multi@/-staff@/.ly}.
@code{\partial}. Similarly, slurs or ties are also not repeated.
+
+@node Repeat syntax
+@unnumberedsubsubsec Repeat syntax
+
+@cindex repeats
+
+LilyPond has one syntactic construct for specifying different types of
+repeats. The syntax is
+
+@example
+\repeat @var{variant} @var{repeatcount} @var{repeatbody}
+@end example
+
+If you have alternative endings, you may add
+@funindex \alternative
+@example
+\alternative @{
+ @var{alternative1}
+ @var{alternative2}
+ @var{alternative3}
+ @dots{}
+@}
+@end example
+
+@noindent
+where each @var{alternative} is a music expression. If you do not
+give enough alternatives for all of the repeats, the first alternative
+is assumed to be played more than once.
+
+The following types of repetition are supported
+
+@table @code
+@item unfold
+Repeated music is fully written (played) out. This is useful when
+entering repetitious music. This is the only kind of repeat that
+is included in MIDI output.
+
+@item volta
+Repeats are not written out, but alternative endings (volte) are
+printed, left to right with brackets. This is the standard notation
+for repeats with alternatives. These are not played in MIDI output by
+default.
+
+
+@item tremolo
+Make tremolo beams. These are not played in MIDI output by default.
+
+@item percent
+Make beat or measure repeats. These look like percent signs. These
+are not played in MIDI output by default. Percent repeats must be
+declared within a @code{Voice} context.
+
+@end table
+
+
@node Manual repeat commands
@unnumberedsubsubsec Manual repeat commands
@subsection Multiple voices
@menu
-* Explicitly instantiating voices::
+* TODO new sec voices::
* Collision Resolution::
* Automatic part combining::
* Writing music in parallel::
@end menu
-@node Explicitly instantiating voices
-@unnumberedsubsubsec Explicitly instantiating voices
-
-@internalsref{Voice} contexts can also be instantiated manually
-inside a @code{<< >>} block to create polyphonic music, using
-@code{\voiceOne}, up to @code{\voiceFour} to assign stem
-directions and a horizontal shift for each part.
-
-Specifically,
-@example
-<< \upper \\ \lower >>
-@end example
-
-@noindent
-is equivalent to
-
-@example
-<<
- \new Voice = "1" @{ \voiceOne \upper @}
- \new Voice = "2" @{ \voiceTwo \lower @}
->>
-@end example
-
-The @code{\voiceXXX} commands set the direction of stems, slurs,
-ties, articulations, text annotations, augmentation dots of dotted
-notes, and fingerings. @code{\voiceOne} and @code{\voiceThree}
-make these objects point upwards, while @code{\voiceTwo} and
-@code{\voiceFour} make them point downwards. The command
-@code{\oneVoice} will revert back to the normal setting.
-
-An expression that appears directly inside a @code{<< >>} belongs
-to the main voice. This is useful when extra voices appear while
-the main voice is playing. Here is a more correct rendition of
-the example from the previous section. The crossed colored
-noteheads demonstrate that the main melody is now in a single
-voice context.
-
-@lilypond[quote,ragged-right,verbatim]
-\new Staff \relative c' {
- \override NoteHead #'style = #'cross
- \override NoteHead #'color = #red
- c16 d e f
- \voiceOne
- <<
- { g4 f e | d2 e2 }
- \new Voice="1" { \voiceTwo
- r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
- \oneVoice
- }
- \new Voice { \voiceThree
- s2. | s4 b4 c2
- \oneVoice
- }
- >>
- \oneVoice
-}
-@end lilypond
-
-The correct definition of the voices allows the melody to be
-slurred.
-
-@lilypond[quote,ragged-right,verbatim]
-\new Staff \relative c' {
- c16^( d e f
- \voiceOne
- <<
- { g4 f e | d2 e2) }
- \context Voice="1" { \voiceTwo
- r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
- \oneVoice
- }
- \new Voice { \voiceThree
- s2. s4 b4 c2
- \oneVoice
- }
- >>
- \oneVoice
-}
-@end lilypond
-
-Avoiding the @code{\\} separator also allows nesting polyphony
-constructs, which in some case might be a more natural way to
-typeset the music.
-
-@lilypond[quote,ragged-right,verbatim]
-\new Staff \relative c' {
- c16^( d e f
- \voiceOne
- <<
- { g4 f e | d2 e2) }
- \context Voice="1" { \voiceTwo
- r8 e4 d c8 ~ |
- <<
- {c8 b16 a b8 g ~ g2}
- \new Voice { \voiceThree
- s4 b4 c2
- \oneVoice
- }
- >>
- \oneVoice
- }
- >>
- \oneVoice
-}
-@end lilypond
+@node TODO new sec voices
+@unnumberedsubsubsec TODO new sec voices
In some instances of complex polyphonic music, you may need
additional voices to avoid collisions between notes. Additional