Next: Explicitly instantiating voices, Up: Polyphony
The easiest way to enter fragments with more than one voice on a staff
is to enter each voice as a sequence (with {...}), and combine
them simultaneously, separating the voices with \\
\new Staff \relative c' {
c16 d e f
<<
{ g4 f e | d2 e2 } \\
{ r8 e4 d c8 ~ | c b16 a b8 g ~ g2 } \\
{ s2. | s4 b4 c2 }
>>
}
The separator causes
Voice contexts1
to be instantiated. They bear the names "1", "2", etc. In
each of these contexts, vertical direction of slurs, stems, etc., is set
appropriately.
These voices are all separate from the voice that contains the notes just
outside the << \\ >> construct. This should be noted when making
changes at the voice level. This also means that slurs and ties cannot go
into or out of a << \\ >> construct. Conversely, parallel voices
from separate << \\ >> constructs on the same staff are the the
same voice. Here is the same example, with different noteheads for each
voice. Note that the change to the note-head style in the main voice does
not affect
the inside of the << \\ >> constructs. Also, the change to the second
voice in the first << \\ >> construct is effective in the second
<< \\ >>, and the voice is tied across the two constructs.
\new Staff \relative c' {
\override NoteHead #'style = #'cross
c16 d e f
<<
{ g4 f e } \\
{ \override NoteHead #'style = #'triangle
r8 e4 d c8 ~ }
>> |
<<
{ d2 e2 } \\
{ c8 b16 a b8 g ~ g2 } \\
{ \override NoteHead #'style = #'slash s4 b4 c2 }
>>
}
Polyphony does not change the relationship of notes within a
\relative { } block. Each note is calculated relative
to the note immediately preceding it.
\relative { noteA << noteB \\ noteC >> noteD }
noteC is relative to noteB, not noteA;
noteD is relative to noteC, not noteB or
noteA.
This page is for LilyPond-2.8.8 (stable-branch).