Previous: Fixing overlapping notation, Up: Collisions of objects
We end this section on Tweaks by showing the steps to be taken to deal with a tricky example which needs several tweaks to produce the desired output. The example has been deliberately chosen to illustrate the use of the Notation Reference to resolve unusual problems with notation. It is not representative of more usual engraving process, so please do not let these difficulties put you off! Fortunately, difficulties like these are not very common!
The example is from Chopin's Première Ballade, Op. 23, bars 6 to 9, the transition from the opening Lento to Moderato. Here, first, is what we want the output to look like, but to avoid over-complicating the example too much we have left out the dynamics, fingering and pedalling.
We note first that the right hand part in the third bar requires four voices. These are the five beamed eighth notes, the tied C, the half-note D which is merged with the eighth note D, and the dotted quarter note F-sharp, which is also merged with the eighth note at the same pitch. Everything else is in a single voice, so the easiest way is to introduce these four voices temporarily at the time they are needed. If you have forgotten how to do this, look at I'm hearing Voices. Let us begin by entering the notes as two variables and setting up the staff structure in a score block, and see what LilyPond produces by default:
rhMusic = \relative c'' { r2 c4. g8 | bes1~ | \time 6/4 bes2. r8 % Start polyphonic section of four voices << {c,8 d fis bes a | } \\ {c,8~ c2 | } \\ {s8 d2 | } \\ {s4 fis4. | } >> g2. } lhMusic = \relative c' { r2 <c g ees>2 | <d g, d>1 | r2. d,,4 r4 r | r4 } \score { \new PianoStaff << \new Staff = "RH" << \key g \minor \rhMusic >> \new Staff = "LH" << \key g \minor \clef "bass" \lhMusic >> >> }
All the notes are right, but the appearance is far from satisfactory. The tie clashes with the change in time signature, the beaming in the third bar is wrong, the notes are not merged together, and several notation elements are missing. Let's first deal with the easier things. We can correct the beaming by inserting a beam manually, and we can easily add the left hand slur and the right hand phrasing slur, since these were all covered in the Tutorial. Doing this gives:
rhMusic = \relative c'' { r2 c4.\( g8 | bes1~ | \time 6/4 bes2. r8 % Start polyphonic section of four voices << {c,8[ d fis bes a] | } \\ {c,8~ c2 | } \\ {s8 d2 | } \\ {s4 fis4. | } >> g2.\) } lhMusic = \relative c' { r2 <c g ees>2( | <d g, d>1) | r2. d,,4 r4 r | r4 } \score { \new PianoStaff << \new Staff = "RH" << \key g \minor \rhMusic >> \new Staff = "LH" << \key g \minor \clef "bass" \lhMusic >> >> }
The first bar is now correct. The second bar contains an arpeggio
and is terminated by a double bar line. How do we do these, as they
have not been mentioned in this Learning Manual? This is where
we need to turn to the Notation Reference. Looking up ‘arpeggio’
and ‘bar line’ in the
index quickly shows us that an arpeggio is produced by appending
\arpeggio
to a chord, and a double bar line is produced by
the \bar "||"
command. That's easily done. We next need
to correct the collision of the tie with the time signature. This
is best done by moving the tie upwards. Moving objects was covered
earlier in Moving objects, which says that objects positioned
relative to the staff can be moved by overriding their
staff-position
property, which is specified in half staff
spaces relative to the center line of the staff. So the following
override placed just before the first tied note would move the tie
up to 3.5 half staff spaces above the center line:
\once \override Tie #'staff-position = #3.5
This completes bar two, giving:
rhMusic = \relative c'' { r2 c4.\( g8 | \once \override Tie #'staff-position = #3.5 bes1~ | \bar "||" \time 6/4 bes2. r8 % Start polyphonic section of four voices << {c,8[ d fis bes a] | } \\ {c,8~ c2 | } \\ {s8 d2 | } \\ {s4 fis4. | } >> g2.\) } lhMusic = \relative c' { r2 <c g ees>2( | <d g, d>1)\arpeggio | r2. d,,4 r4 r | r4 } \score { \new PianoStaff << \new Staff = "RH" << \key g \minor \rhMusic >> \new Staff = "LH" << \key g \minor \clef "bass" \lhMusic >> >> }
On to bar three and the start of the Moderato section. The
tutorial showed how to add embolded text with the \markup
command, so adding ‘Moderato’ in bold is easy.
But how do we merge notes in different voices together? This is
where we need to turn to the Notation Reference for help. A search
for “merge” in the Notation Reference index quickly leads us to
the commands for merging differently headed and differently
dotted notes in Collision resolution. In our
example we need to merge both types of note for the duration
of the polyphonic section in bar 3, so using the information
we find in the Notation Reference we add
\mergeDifferentlyHeadedOn \mergeDifferentlyDottedOn
to the start of that section and
\mergeDifferentlyHeadedOff \mergeDifferentlyDottedOff
to the end, giving:
rhMusic = \relative c'' { r2 c4.\( g8 | \once \override Tie #'staff-position = #3.5 bes1~ | \bar "||" \time 6/4 bes2.^\markup {\bold "Moderato"} r8 \mergeDifferentlyHeadedOn \mergeDifferentlyDottedOn % Start polyphonic section of four voices << {c,8[ d fis bes a] | } \\ {c,8~ c2 | } \\ {s8 d2 | } \\ {s4 fis4. | } >> \mergeDifferentlyHeadedOff \mergeDifferentlyDottedOff g2.\) } lhMusic = \relative c' { r2 <c g ees>2( | <d g, d>1)\arpeggio | r2. d,,4 r4 r | r4 } \score { \new PianoStaff << \new Staff = "RH" << \key g \minor \rhMusic >> \new Staff = "LH" << \key g \minor \clef "bass" \lhMusic >> >> }
These overrides have merged the two F-sharp notes, but not the two
on D. Why not? The answer is there in the same section in the
Notation Reference – notes being merged must have stems in
opposite directions and two notes cannot be merged successfully if
there is a third note in the same note column. Here the two D's
both have upward stems and there is a third note – the C. We know
how to change the stem direction using \stemDown
, and
the Notation Reference also says how to move the C – apply a shift
using one of the \shift
commands. But which one?
The C is in voice two which has shift off, and the two D's are in
voices one and three, which have shift off and shift on,
respectively. So we have to shift the C a further level still
using \shiftOnn
to avoid it interfering with the two D's.
Applying these changes gives:
rhMusic = \relative c'' { r2 c4.\( g8 | \once \override Tie #'staff-position = #3.5 bes1~ | \bar "||" \time 6/4 bes2.^\markup {\bold "Moderato"} r8 \mergeDifferentlyHeadedOn \mergeDifferentlyDottedOn % Start polyphonic section of four voices << {c,8[ d fis bes a] | } \\ % Move the c2 out of the main note column so the merge will work {c,8~ \shiftOnn c2 | } \\ % Stem on the d2 must be down to permit merging {s8 \stemDown d2 | } \\ {s4 fis4. | } >> \mergeDifferentlyHeadedOff \mergeDifferentlyDottedOff g2.\) } lhMusic = \relative c' { r2 <c g ees>2( | <d g, d>1)\arpeggio | r2. d,,4 r4 r | r4 } \score { \new PianoStaff << \new Staff = "RH" << \key g \minor \rhMusic >> \new Staff = "LH" << \key g \minor \clef "bass" \lhMusic >> >> }
Nearly there. Only two problems remain: The downward stem on the
merged D should not be there, and the C would be better positioned
to the right of the D's. We know how to do both of these from the
earlier tweaks: we make the stem transparent, and move the C with
the force-hshift
property. Here's the final result:
rhMusic = \relative c'' { r2 c4.\( g8 | \once \override Tie #'staff-position = #3.5 bes1~ | \bar "||" \time 6/4 bes2.^\markup {\bold "Moderato"} r8 \mergeDifferentlyHeadedOn \mergeDifferentlyDottedOn << {c,8[ d fis bes a] | } \\ % Reposition the c2 to the right of the merged note {c,8~ \once \override NoteColumn #'force-hshift = #1.0 % Move the c2 out of the main note column so the merge will work \shiftOnn c2} \\ % Stem on the d2 must be down to permit merging {s8 \stemDown \once \override Stem #'transparent = ##t d2} \\ {s4 fis4.} >> \mergeDifferentlyHeadedOff \mergeDifferentlyDottedOff g2.\) } lhMusic = \relative c' { r2 <c g ees>2( | <d g, d>1)\arpeggio | r2. d,,4 r4 r | r4 } \score { \new PianoStaff << \new Staff = "RH" << \key g \minor \rhMusic >> \new Staff = "LH" << \key g \minor \clef "bass" \lhMusic >> >> }
Diese Seite ist für LilyPond-2.11.58 (Entwicklungszweig).
Fehler bitte an http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs melden.
Ihre Vorschläge für die Dokumentation sind willkommen.
Andere Sprachen: español.