This patch should prevent the type of confusion that leads to bug #45: http://code.google.com/p/lilypond/issues/detail?id=45
Comments/objections? Okay to push? - Mark
From e7b56245a794067916dd8766562b4a7cfb43a95a Mon Sep 17 00:00:00 2001 From: Mark Polesky <markpole...@yahoo.com> Date: Sat, 18 Sep 2010 11:17:03 -0700 Subject: [PATCH] Doc: LM 3.2: Entering voices in the correct order. --- Documentation/learning/fundamental.itely | 186 +++++++++++++++++++++++++---- 1 files changed, 160 insertions(+), 26 deletions(-) diff --git a/Documentation/learning/fundamental.itely b/Documentation/learning/fundamental.itely index 811b1dc..65b434d 100644 --- a/Documentation/learning/fundamental.itely +++ b/Documentation/learning/fundamental.itely @@ -670,12 +670,94 @@ separately, like this: @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 +used to encode three or more voices by adding more backslash separators. -The Voice contexts bear the names @code{"1"}, @code{"2"}, etc. -In each of these contexts, the vertical direction of slurs, -stems, ties, dynamics etc., is set appropriately. +When entering multiple voices in the input file, always put the +highest voice first and the lowest voice second. Enter any +additional voices in this order: + +...@example +Voice 1: highest +Voice 2: lowest +Voice 3: second highest +Voice 4: second lowest +Voice 5: third highest +Voice 6: third lowest +etc. +...@end example + +Though this may seem counterintuitive, it simplifies the automatic +layout process. Note that the odd-numbered voices are given +upstems, and the even-numbered voices are given downstems. The +following image demonstrates this visually: + +...@c do not use verbatim here +...@lilypond[quote] +\new Staff { + \override Staff.Fingering #'whiteout = ##t + \time 2/4 + << + { b'2^1 } % 1 + \\ { g'2_2 } % 2 + >> + << + { d''2^1 } % 1 + \\ { g'2_2 } % 2 + \\ { \set fingeringOrientations = #'(right) + <b'-3>2 } % 3 + >> + << + { d''2^1 } % 1 + \\ { e'2_2 } % 2 + \\ { <b'-3>2 } % 3 + \\ { \set fingeringOrientations = #'(left) + <g'-4>2 } % 4 + >> + << + { f''2^1 } % 1 + \\ { e'2_2 } % 2 + \\ { \override Fingering #'extra-offset = #'(0.7 . 0.2) + <d''-3>2 } % 3 + \\ { <g'-4>2 } % 4 + \\ { \set fingeringOrientations = #'(right) + \override Fingering #'extra-offset = #'(0 . -0.2) + <b'-5>2 } % 5 + >> + << + { f''2^1 } % 1 + \\ { c'2_2 } % 2 + \\ { <d''-3>2 } % 3 + \\ { \override Fingering #'extra-offset = #'(-0.6 . -0.2) + <e'-4>2 } % 4 + \\ { <b'-5>2 } % 5 + \\ { \set fingeringOrientations = #'(left) + \override Fingering #'extra-offset = #'(0 . 0.2) + <g'-6>2 } % 6 + >> +} +...@end lilypond + +For example, the third measure above could be entered like this: + +...@example +<< + @{ d2 @} % highest + \\ + @{ e,2 @} % lowest + \\ + @{ b'2 @} % second highest + \\ + @{ g2 @} % second lowest +>> +...@end example + +The Voice contexts are automatically assigned the names +...@code{"1"}, @code{"2"}, etc. In each of these contexts, the +vertical direction of slurs, stems, ties, dynamics etc., is set +appropriately. Here is a longer example using three voices: + +...@c TODO: add dynamics once the "voiceOne dynamics" bug is fixed. @lilypond[quote,verbatim,fragment] \new Staff \relative c' { @@ -1136,28 +1218,80 @@ as here: @funindex shiftOnnn Closely spaced notes in a chord, or notes occurring at the same -time in different voices, are arranged in two, occasionally more, -columns to prevent the note heads overlapping. These are called -note columns. There are separate columns for each voice, and -the currently specified voice-dependent shift is applied to the -note column if there would otherwise be a collision. This can -be seen in the example above. In bar 2 the C in voice two is -shifted to the right relative to the D in voice one, and in the -final chord the C in voice three is also shifted to the right -relative to the other notes. - -The @code{\shiftOn}, @code{\shiftOnn}, @code{\shiftOnnn}, and -...@code{\shiftoff} commands specify the degree to which notes and -chords of the voice should be shifted if a collision -would otherwise occur. By default, the outer voices (normally -voices one and two) have @code{\shiftOff} specified, while the -inner voices (three and four) have @code{\shiftOn} specified. -When a shift is applied, voices one and three are shifted to -the right and voices two and four to the left. - -...@code{\shiftonn} and @code{\shiftOnnn} define further shift -levels which may be specified temporarily to resolve collisions -in complex situations -- see @ref{Real music example}. +time in different voices, are arranged in two or more columns to +prevent the note heads overlapping. These are called note +columns. There are separate columns for each voice, and the +currently specified voice-dependent shift is applied to the note +column if there would otherwise be a collision. This can be seen +in the example above. In bar 2 the C in voice two is shifted to +the right relative to the D in voice one, and in the final chord +the C in voice three is also shifted to the right relative to the +other notes. + +The @code{\shiftOn} command allows (but does not force) the notes +in a voice to be shifted. When @code{\shiftOn} is applied to a +voice, a note or chord in that voice is shifted only if its stem +would otherwise collide with a stem from another voice, and only +if the colliding stems point in the same direction. The +...@code{\shiftoff} command prevents this type of shifting from +occuring. + +By default, the outer voices (normally voices one and two) have +...@code{\shiftoff} specified, while the inner voices (three and +four) have @code{\shiftOn} specified. When a shift is applied, +voices with upstems (voices one and three) are shifted to the +right, and voices with downstems (voices two and four) are shifted +to the left. + +The following image shows the four voices in their conventional +positions, with the default shifts applied: + +...@c do not use verbatim here +...@lilypond[quote] +\new Staff { + \time 2/4 + \once \override Staff.Fingering #'whiteout = ##t + << + { f''2^1 } + \\ { g'2_2 } + \\ { \set fingeringOrientations = #'(right) <d''-3>2 } + \\ { \set fingeringOrientations = #'(left) <b'-4>2 } + >> +} +...@end lilypond + +Here is an example to help you visualize how an abbreviated +polyphonic expression would be expanded internally. Note that +with three or more voices, the vertical order of voices in your +input file should not be the same as the vertical order of voices +on the staff! + +...@lilypond[quote,verbatim] +\new Staff \relative c'' { + %% abbreviated entry + << + { f2 } % highest + \\ + { g,2 } % lowest + \\ + { d'2 } % upper middle + \\ + { b2 } % lower middle + >> + %% internal expansion of the above + << + \new Voice = "1" { \voiceOne \shiftOff f'2 } + \new Voice = "2" { \voiceTwo \shiftOff g,2 } + \new Voice = "3" { \voiceThree \shiftOn d'2 } % shifts right + \new Voice = "4" { \voiceFour \shiftOn b2 } % shifts left + >> +} +...@end lilypond + +Two additional commands, @code{\shiftOnn} and @code{\shiftOnnn} +provide further shift levels which may be specified temporarily to +resolve collisions in complex situations -- see @ref{Real music +example}. A note column can contain just one note (or chord) from a voice with stems up and one note (or chord) from a voice with stems -- 1.6.3.3
_______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel