I'm scoring Bach BWV927 in LilyPond. For each hand, at various measures there are two voices. The left-hand second voice starts in the first measure, but the right-hand second voice starts in the third measure.
At the moment, I'm adding rests to position the right-hand second voice correctly, but I don't want its rests to appear. How do I start a voice in a specific measure?
\version "2.20"
\header {
title = "Prelude in F - BWV 927"
subtitle = "Kleine Praledien Fughetten. 8"
composer = "J.S. Bach (1685-1750)"
}
global = {
\key f \major
\time 4/4
\tempo 4 = 28
}
rightvoiceone = {
\relative b' {
r16 c16 a c f, c' a c f, d' bes-3 d f, d' bes d |
g,-1 e'-5 bes-2 e g, e' bes-2 e-4 f c-2 a c-3 f, r8. |
r8 f' f f r8 f f f | \break
r8 g bes g a4 r4
\bar "|."
}
}
rightvoicetwo = {
\relative b' {
R1 | R1 |
r8 c a c r8 d bes d | \break
r8 e e e <c f>4 r4
}
}
leftvoiceone = {
\relative c {
\stemDown
f8 f8 f8 f8 r8 f8 f8 f8 |
r8 f8 f8 f8 f4 r16 c'16 a16 c16 | f,16 c' a c f, c' a c f, d' bes d f, d' bes d |
g, e' bes e g, e' bes e f c a c f, c a c |
}
}
leftvoicetwo = {
\relative c' {
\stemUp
a8 c8 a8 c8 r8 d8 bes8 d8 | r8 g,8 bes8 g8 a4
}
}
\score {
\context PianoStaff <<
\context Staff = "rh" <<
\global
\clef "treble"
\new Voice = "rhfirst"
{ \voiceOne \rightvoiceone }
\new Voice = "rhsecond"
{ \voiceTwo \rightvoicetwo }
>>
\context Staff = "lh" <<
\global
\clef "bass"
\new Voice = "lhfirst"
{ \voiceOne \leftvoiceone }
\new Voice= "lhsecond"
{ \voiceTwo \leftvoicetwo }
>>
>>
\layout { }
\midi { }
}