]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/simultaneous.itely
Docs: reorganize documentation directory structure
[lilypond.git] / Documentation / notation / simultaneous.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @ignore
3     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
4
5     When revising a translation, copy the HEAD committish of the
6     version that you are working on.  See TRANSLATION for details.
7 @end ignore
8
9 @c \version "2.12.0"
10
11
12 @node Simultaneous notes
13 @section Simultaneous notes
14
15 @lilypondfile[quote]{simultaneous-headword.ly}
16
17 Polyphony in music refers to having more than one voice occurring
18 in a piece of music.  Polyphony in LilyPond refers to having more
19 than one voice on the same staff.
20
21 @menu
22 * Single voice::
23 * Multiple voices::
24 @end menu
25
26
27 @node Single voice
28 @subsection Single voice
29
30 This section discusses simultaneous notes inside the same voice.
31
32 @menu
33 * Chorded notes::
34 * Simultaneous expressions::
35 * Clusters::
36 @end menu
37
38
39 @node Chorded notes
40 @unnumberedsubsubsec Chorded notes
41
42 @cindex chords
43 @cindex brackets, angle
44 @cindex angle brackets
45 @cindex relative pitch in chords
46
47 @funindex <
48 @funindex >
49 @funindex <...>
50
51 A chord is formed by enclosing a set of pitches between @code{<}
52 and @code{>}.  A chord may be followed by a duration and/or a set
53 of articulations, just like simple notes:
54
55 @lilypond[verbatim,quote,relative=1]
56 <c e g>2 <c f a>4-> <e g c>-.
57 @end lilypond
58
59 Relative mode can be used for pitches in chords. The octave of each
60 pitch is chosen using the preceding pitch as a reference except in
61 the case of the first pitch in a chord: the reference for the first
62 pitch is the @emph{first} pitch of the preceding chord.
63
64 For more information about chords, see @ref{Chord notation}.
65
66
67 @seealso
68 Music Glossary:
69 @rglos{chord}.
70
71 Learning Manual:
72 @rlearning{Combining notes into chords}.
73
74 Notation Reference:
75 @ref{Chord notation}.
76
77 Snippets:
78 @rlsr{Simultaneous notes}.
79
80
81 @node Simultaneous expressions
82 @unnumberedsubsubsec Simultaneous expressions
83
84 One or more music expressions enclosed in double angle brackets are
85 taken to be simultaneous.  If the first expression begins with a
86 single note or if the whole simultaneous expression appears
87 explicitly within a single voice, the whole expression is placed on
88 a single staff; otherwise the elements of the simultaneous
89 expression are placed on separate staves.
90
91 The following examples show simultaneous expressions on one staff:
92
93 @lilypond[quote,verbatim,relative=2]
94 \new Voice {  % explicit single voice
95   << { a4 b g2 } { d4 g c,2 } >>
96 }
97 @end lilypond
98
99 @lilypond[quote,verbatim,relative=2]
100 % single first note
101 a << { a4 b g } { d4 g c, } >>
102 @end lilypond
103
104 This can be useful if the simultaneous sections have identical
105 rhythms, but attempts to attach notes with different durations
106 to the same stem will cause errors.
107
108 The following example shows how simultaneous expressions can
109 generate multiple staves implicitly:
110
111 @lilypond[quote,verbatim,relative=2]
112 % no single first note
113 << { a4 b g2 } { d4 g2 c,4 } >>
114 @end lilypond
115
116 Here different rhythms cause no problems.
117
118
119 @node Clusters
120 @unnumberedsubsubsec Clusters
121
122 @cindex cluster
123 @cindex note cluster
124
125 @funindex \makeClusters
126 @funindex makeClusters
127
128 A cluster indicates a continuous range of pitches to be played.
129 They can be denoted as the envelope of a set of notes.  They are
130 entered by applying the function @code{\makeClusters} to a sequence
131 of chords, e.g.,
132
133 @lilypond[quote,relative=2,verbatim]
134 \makeClusters { <g b>2 <c g'> }
135 @end lilypond
136
137 Ordinary notes and clusters can be put together in the same staff,
138 even simultaneously.  In such a case no attempt is made to
139 automatically avoid collisions between ordinary notes and clusters.
140
141
142 @seealso
143 Music Glossary:
144 @rglos{cluster}.
145
146 Snippets:
147 @rlsr{Simultaneous notes}.
148
149 Internals Reference:
150 @rinternals{ClusterSpanner},
151 @rinternals{ClusterSpannerBeacon},
152 @rinternals{Cluster_spanner_engraver}.
153
154
155 @knownissues
156
157 Clusters look good only if they span at least two chords; otherwise
158 they appear too narrow.
159
160 Clusters do not have a stem and cannot indicate durations by
161 themselves, but the length of the printed cluster is determined by
162 the durations of the defining chords.  Separate clusters need a
163 separating rest between them.
164
165 Clusters do not produce MIDI output.
166
167 @node Multiple voices
168 @subsection Multiple voices
169
170 This section discusses simultaneous notes in multiple voices or
171 multiple staves.
172
173 @menu
174 * Single-staff polyphony::
175 * Voice styles::
176 * Collision resolution::
177 * Automatic part combining::
178 * Writing music in parallel::
179 @end menu
180
181
182 @node Single-staff polyphony
183 @unnumberedsubsubsec Single-staff polyphony
184
185 @cindex single-staff polyphony
186 @cindex polyphony, single-staff
187 @cindex voice
188 @cindex lyrics assigned to one voice
189
190 @funindex \voiceOne
191 @funindex voiceOne
192 @funindex \voiceOne ... \voiceFour
193 @funindex Voice
194 @funindex \oneVoice
195 @funindex oneVoice
196
197 @strong{@i{Explicitly instantiating voices}}
198
199 The basic structure needed to achieve multiple independent
200 voices in a single staff is illustrated in the following example:
201
202 @lilypond[quote,relative=3,verbatim]
203 \new Staff <<
204   \new Voice = "first"
205     { \voiceOne r8 r16 g e8. f16 g8[ c,] f e16 d }
206   \new Voice= "second"
207     { \voiceTwo d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. }
208 >>
209 @end lilypond
210
211 Here, voices are instantiated explicitly and are given names. The
212 @code{\voiceOne} ... @code{\voiceFour} commands set up the voices
213 so that first and third voices get stems up, second and fourth
214 voices get stems down, third and fourth voice note heads are
215 horizontally shifted, and rests in the respective voices are
216 automatically moved to avoid collisions.  The @code{\oneVoice}
217 command returns all the voice settings to the neutral default
218 directions.
219
220 @strong{@i{Temporary polyphonic passages}}
221
222 A temporary polyphonic passage can be created with the following
223 construct:
224
225 @example
226 << @{ \voiceOne ... @}
227   \new Voice @{ \voiceTwo ... @}
228 >> \oneVoice
229 @end example
230
231 Here, the first expression within a temporary polyphonic passage is
232 placed into the @code{Voice} context which was in use immediately
233 before the polyphonic passage, and that same @code{Voice} context
234 continues after the temporary section.  Other expressions within
235 the angle brackets are assigned to distinct temporary voices.
236 This allows lyrics to be assigned to one continuing voice before,
237 during and after a polyphonic section:
238
239 @lilypond[quote, verbatim, relative=2]
240 <<
241   \new Voice = "melody" {
242     a4
243     <<
244       {
245         \voiceOne
246         g f
247       }
248       \new Voice {
249         \voiceTwo
250         d2
251       }
252     >>
253     \oneVoice
254     e4
255   }
256   \new Lyrics \lyricsto "melody" {
257   This is my song.
258   }
259 >>
260 @end lilypond
261
262 Here, the @code{\voiceOne} and @code{\voiceTwo} commands are
263 required to define the settings of each voice.
264
265 @strong{@i{The double backslash construct}}
266
267 The @code{<< @{...@} \\ @{...@} >>} construct, where the two (or
268 more) expressions are separated by double backslashes, behaves
269 differently to the similar construct without the double backslashes:
270 @emph{all} the expressions within this contruct are assigned
271 to new @code{Voice} contexts.  These new @code{Voice} contexts
272 are created implicitly and are given the fixed names @code{"1"},
273 @code{"2"}, etc.
274
275 The first example could be typeset as follows:
276
277 @lilypond[quote,relative=3,verbatim]
278 <<
279   { r8 r16 g e8. f16 g8[ c,] f e16 d }
280   \\
281   { d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. }
282 >>
283 @end lilypond
284
285 This syntax can be used where it does not matter that temporary
286 voices are created and then discarded.  These implicitly created
287 voices are given the settings equivalent to the effect of the
288 @code{\voiceOne} ... @code{\voiceFour} commands, in the order in
289 which they appear in the code.
290
291 In the following example, the intermediate voice has stems up,
292 therefore we enter it in the third place, so it becomes voice
293 three, which has the stems up as desired.  Spacer rests are
294 used to avoid printing doubled rests.
295
296 @lilypond[quote,relative=3,verbatim]
297 <<
298   { r8 g g  g g f16 ees f8 d }
299   \\
300   { ees,8 r ees r d r d r }
301   \\
302   { d'8 s c s bes s a s }
303 >>
304 @end lilypond
305
306 In all but the simplest works it is advisable to create explicit
307 @code{Voice} contexts as explained in @rlearning{Contexts and engravers} and
308 @rlearning{Explicitly instantiating voices}.
309
310 @strong{@i{Identical rhythms}}
311
312 In the special case that we want to typeset parallel pieces of music
313 that have the same rhythm, we can combine them into a single
314 @code{Voice} context, thus forming chords.  To achieve this, enclose
315 them in a simple simultaneous music construct within an explicit voice:
316
317 @lilypond[quote,relative=2,verbatim]
318 \new Voice <<
319   { e4 f8 d e16 f g8 d4 }
320   { c4 d8 b c16 d e8 b4 }
321 >>
322 @end lilypond
323
324 This method leads to strange beamings and warnings if the pieces of
325 music do not have the same rhythm.
326
327
328 @predefined
329 @code{\voiceOne},
330 @code{\voiceTwo},
331 @code{\voiceThree},
332 @code{\voiceFour},
333 @code{\oneVoice}.
334 @endpredefined
335
336
337 @seealso
338 Learning Manual:
339 @rlearning{Voices contain music},
340 @rlearning{Explicitly instantiating voices}.
341
342 Notation Reference:
343 @ref{Percussion staves},
344 @ref{Invisible rests},
345 @ref{Stems}.
346
347 Snippets:
348 @rlsr{Simultaneous notes}.
349
350
351 @node Voice styles
352 @unnumberedsubsubsec Voice styles
353
354 @cindex voice styles
355 @cindex styles, voice
356 @cindex coloring voices
357 @funindex \voiceOneStyle
358 @funindex \voiceTwoStyle
359 @funindex \voiceThreeStyle
360 @funindex \voiceFourStyle
361 @funindex \voiceNeutralStyle
362
363 Voices may be given distinct colors and shapes, allowing them to be
364 easily identified:
365
366 @lilypond[quote,relative=2,verbatim]
367 <<
368   { \voiceOneStyle d4 c2 b4 }
369   \\
370   { \voiceTwoStyle e,2 e }
371   \\
372   { \voiceThreeStyle b2. c4 }
373   \\
374   { \voiceFourStyle g'2 g }
375 >>
376 @end lilypond
377
378 The @code{\voiceNeutralstyle} command is used to revert to the
379 standard presentation.
380
381
382 @predefined
383 @code{\voiceOneStyle},
384 @code{\voiceTwoStyle},
385 @code{\voiceThreeStyle},
386 @code{\voiceFourStyle},
387 @code{\voiceNeutralStyle}.
388 @endpredefined
389
390
391 @seealso
392 Learning Manual:
393 @rlearning{I'm hearing Voices},
394 @rlearning{Other sources of information}.
395
396 Snippets:
397 @rlsr{Simultaneous notes}.
398
399
400 @node Collision resolution
401 @unnumberedsubsubsec Collision resolution
402
403 @cindex merging notes
404 @cindex note collisions
405 @cindex collisions
406 @cindex shift note
407 @cindex multiple voices
408 @cindex voices, multiple
409 @cindex polyphonic music
410 @cindex shifting voices
411 @cindex voices, multiple
412 @cindex shift rest, automatic
413 @funindex \shiftOn
414 @funindex shiftOn
415 @funindex \shiftOnn
416 @funindex shiftOnn
417 @funindex \shiftOnnn
418 @funindex shiftOnnn
419 @funindex \shiftOff
420 @funindex shiftOff
421 @funindex \mergeDifferentlyDottedOn
422 @funindex mergeDifferentlyDottedOn
423 @funindex \mergeDifferentlyDottedOff
424 @funindex mergeDifferentlyDottedOff
425 @funindex \mergeDifferentlyHeadedOn
426 @funindex mergeDifferentlyHeadedOn
427 @funindex \mergeDifferentlyHeadedOff
428 @funindex mergeDifferentlyHeadedOff
429
430 The note heads of notes in different voices with the same pitch,
431 same note head and opposite stem direction are automatically
432 merged, but notes with different note heads or the same stem
433 direction are not.  Rests opposite a stem in a different voice
434 are shifted vertically.
435
436 @lilypond[quote,verbatim,relative=2]
437 <<
438   {
439     c8 d e d c d c4
440     g'2 fis
441   } \\ {
442     c2 c8. b16 c4
443     e,2 r
444   } \\ {
445     \oneVoice
446     s1
447     e8 a b c d2
448   }
449 >>
450 @end lilypond
451
452 Notes with different note heads may be merged, with the
453 exception of half-note heads and quarter-note heads:
454
455 @lilypond[quote,verbatim,relative=2]
456 <<
457   {
458     \mergeDifferentlyHeadedOn
459     c8 d e d c d c4
460     g'2 fis
461   } \\ {
462     c2 c8. b16 c4
463     e,2 r
464   } \\ {
465     \oneVoice
466     s1
467     e8 a b c d2
468   }
469 >>
470 @end lilypond
471
472 Note heads with different dots may be merged:
473
474 @lilypond[quote,relative=2,verbatim]
475 <<
476   {
477     \mergeDifferentlyHeadedOn
478     \mergeDifferentlyDottedOn
479     c8 d e d c d c4
480     g'2 fis
481   } \\ {
482     c2 c8. b16 c4
483     e,2 r
484   } \\ {
485     \oneVoice
486     s1
487     e8 a b c d2
488   }
489 >>
490 @end lilypond
491
492
493 The half note and eighth note at the start of the second measure
494 are incorrectly merged because @code{\mergeDifferentlyHeadedOn}
495 cannot successfully complete the merge when three or more notes
496 line up in the same column, and in this case a warning is given.
497 To allow the merge to work properly a @code{\shift} must be applied
498 to the note that should not be merged.  Here, @code{\shiftOn} is
499 applied to move the top @notation{g} out of the column, and
500 @code{\mergeDifferentlyHeadedOn} then works properly.
501
502 @lilypond[quote,relative=2,verbatim]
503 <<
504   {
505     \mergeDifferentlyHeadedOn
506     \mergeDifferentlyDottedOn
507     c8 d e d c d c4
508     \shiftOn
509     g'2 fis
510   } \\ {
511     c2 c8. b16 c4
512     e,2 r
513   } \\ {
514     \oneVoice
515     s1
516     e8 a b c d2
517   }
518
519 >>
520 @end lilypond
521
522 The @code{\shiftOn}, @code{\shiftOnn}, and @code{\shiftOnnn}
523 commands specify the degree to which chords of the current voice
524 should be shifted.  The outer voices (normally: voices one and
525 two) have @code{\shiftOff}, while the inner voices (three and
526 four) have @code{\shiftOn}.  @code{\shiftOnn} and
527 @code{\shiftOnnn} define further shift levels.
528
529 Notes are only merged if they have opposing stem directions (e.g. in
530 @code{Voice} 1 and 2).
531
532
533 @predefined
534 @code{\mergeDifferentlyDottedOn},
535 @code{\mergeDifferentlyDottedOff},
536 @code{\mergeDifferentlyHeadedOn},
537 @code{\mergeDifferentlyHeadedOff}.
538
539 @code{\shiftOn},
540 @code{\shiftOnn},
541 @code{\shiftOnnn},
542 @code{\shiftOff}.
543 @endpredefined
544
545
546 @snippets
547
548 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
549 {additional-voices-to-avoid-collisions.ly}
550
551 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
552 {forcing-horizontal-shift-of-notes.ly}
553
554
555 @seealso
556 Music Glossary:
557 @rglos{polyphony}.
558
559 Learning Manual:
560 @rlearning{Multiple notes at once},
561 @rlearning{Voices contain music},
562 @rlearning{Collisions of objects}.
563
564 Snippets:
565 @rlsr{Simultaneous notes}.
566
567 Internals Reference:
568 @rinternals{NoteColumn},
569 @rinternals{NoteCollision},
570 @rinternals{RestCollision}.
571
572
573 @knownissues
574
575 @ignore
576 @c TODO investigate! Sometimes it works, sometimes not. --FV
577 The requirements for successfully merging different note heads that
578 are at the same time differently dotted are not clear.
579 @end ignore
580
581 There is no support for chords where the same note occurs with
582 different accidentals in the same chord.  In this case, it is
583 recommended to use enharmonic transcription, or to use special
584 cluster notation (see @ref{Clusters}).
585
586
587 @node Automatic part combining
588 @unnumberedsubsubsec Automatic part combining
589
590 @cindex automatic part combining
591 @cindex part combiner
592 @cindex combining parts
593 @cindex a due part
594 @cindex solo part
595 @funindex \partcombine
596 @funindex partcombine
597
598 Automatic part combining is used to merge two parts of music onto
599 a staff.  It is aimed at typesetting orchestral scores.  When the
600 two parts are identical for a period of time, only one is shown.
601 In places where the two parts differ, they are typeset as separate
602 voices, and stem directions are set automatically.  Also, solo and
603 @notation{a due} parts are identified and marked by default.
604
605 The syntax for part combining is:
606
607 @example
608 \partcombine @var{musicexpr1} @var{musicexpr2}
609 @end example
610
611 The following example demonstrates the basic functionality of the
612 part combiner: putting parts on one staff and setting stem
613 directions and polyphony.  The same variables are used for the
614 independent parts and the combined staff.
615
616 @lilypond[quote,verbatim]
617 instrumentOne = \relative c' {
618   c4 d e f
619   R1
620   d'4 c b a
621   b4 g2 f4
622   e1
623 }
624
625 instrumentTwo = \relative g' {
626   R1
627   g4 a b c
628   d c b a
629   g f( e) d
630   e1
631 }
632
633 <<
634   \new Staff \instrumentOne
635   \new Staff \instrumentTwo
636   \new Staff \partcombine \instrumentOne \instrumentTwo
637 >>
638 @end lilypond
639
640 The notes in the third measure appear only once, although they were
641 specified in both parts.  Stem, slur, and tie directions are set
642 automatically, depending whether there is a solo or unison.  When
643 needed in polyphony situations, the first part (with context called
644 @code{one}) always gets up stems, while the second (called @code{two})
645 always gets down stems.  In solo situations, the first and second
646 parts get marked with @q{Solo} and @q{Solo II}, respectively.  The
647 unisono (@notation{a due}) parts are marked by default with the text
648 @qq{a2}.
649
650 Both arguments to @code{\partcombine} will be interpreted as
651 @code{Voice} contexts.  If using relative octaves,
652 @code{\relative} should be specified for both music expressions,
653 i.e.,
654
655 @example
656 \partcombine
657   \relative @dots{} @var{musicexpr1}
658   \relative @dots{} @var{musicexpr2}
659 @end example
660
661 @noindent
662 A @code{\relative} section that is outside of @code{\partcombine}
663 has no effect on the pitches of @var{musicexpr1} and
664 @var{musicexpr2}.
665
666 @snippets
667
668 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
669 {combining-two-parts-on-the-same-staff.ly}
670
671 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
672 {changing-partcombine-texts.ly}
673
674
675 @seealso
676 Music Glossary:
677 @rglos{a due},
678 @rglos{part}.
679
680 Notation Reference:
681 @ref{Writing parts}.
682
683 Snippets:
684 @rlsr{Simultaneous notes}.
685
686 Internals Reference:
687 @rinternals{PartCombineMusic},
688 @rinternals{Voice}.
689
690
691 @knownissues
692
693 @code{\partcombine} can only accept two voices.
694
695 When @code{printPartCombineTexts} is set, if the two voices play
696 the same notes on and off, the part combiner may typeset @code{a2}
697 more than once in a measure.
698
699 @code{\partcombine} cannot be inside @code{\times}.
700
701 @code{\partcombine} cannot be inside @code{\relative}.
702
703 Internally, the @code{\partcombine} interprets both arguments as
704 @code{Voice}s and decides when the parts can be combined.  When they have
705 different durations they cannot be combined and are given the names
706 @code{one} and @code{two}.  Consequently, if the arguments switch to
707 differently named @rinternals{Voice} contexts, the events in those will
708 be ignored.  Likewise, partcombining isn't designed to work with lyrics;
709 when one of the voices is explicitly named in order to attach lyrics to
710 it, the partcombining stops working.
711
712 @code{\partcombine} only observes onset times of notes. It cannot
713 determine whether a previously started note is playing or not, leading
714 to various problems.
715
716
717 @node Writing music in parallel
718 @unnumberedsubsubsec Writing music in parallel
719
720 @cindex writing music in parallel
721 @cindex interleaved music
722 @cindex parallel music
723 @funindex \parallelMusic
724 @funindex parallelMusic
725
726 Music for multiple parts can be interleaved in input code.  The
727 function @code{\parallelMusic} accepts a list with the names of a
728 number of variables to be created, and a musical expression.  The
729 content of alternate measures from the expression become the value
730 of the respective variables, so you can use them afterwards to
731 print the music.
732
733 @warning{Bar checks @code{|} must be used, and the measures must
734 be of the same length.}
735
736 @lilypond[quote,verbatim]
737 \parallelMusic #'(voiceA voiceB voiceC) {
738   % Bar 1
739   r8 g'16 c'' e'' g' c'' e'' r8 g'16 c'' e'' g' c'' e'' |
740   r16 e'8.~   e'4            r16 e'8.~   e'4            |
741   c'2                        c'2                        |
742
743   % Bar 2
744   r8 a'16 d'' f'' a' d'' f'' r8 a'16 d'' f'' a' d'' f'' |
745   r16 d'8.~   d'4            r16 d'8.~   d'4            |
746   c'2                        c'2                        |
747
748 }
749 \new StaffGroup <<
750   \new Staff << \voiceA \\ \voiceB >>
751   \new Staff { \clef bass \voiceC }
752 >>
753 @end lilypond
754
755 Relative mode may be used.  Note that the @code{\relative} command
756 is not used inside @code{\parallelMusic} itself.  The notes are
757 relative to the preceding note in the voice, not to the previous
758 note in the input -- in other words, relative notes for
759 @code{voiceA} ignore the notes in @code{voiceB}.
760
761 @lilypond[quote,verbatim]
762 \parallelMusic #'(voiceA voiceB voiceC) {
763   % Bar 1
764   r8 g16 c e g, c e r8 g,16 c e g, c e  |
765   r16 e8.~ e4       r16 e8.~  e4        |
766   c2                c                   |
767
768   % Bar 2
769   r8 a,16 d f a, d f r8 a,16 d f a, d f |
770   r16 d8.~  d4       r16 d8.~  d4       |
771   c2                 c                  |
772
773  }
774 \new StaffGroup <<
775   \new Staff << \relative c'' \voiceA \\ \relative c' \voiceB >>
776   \new Staff \relative c' { \clef bass \voiceC }
777 >>
778 @end lilypond
779
780 This works quite well for piano music.  This example maps four
781 consecutive measures to four variables:
782
783 @lilypond[quote,verbatim]
784 global = {
785   \key g \major
786   \time 2/4
787 }
788
789 \parallelMusic #'(voiceA voiceB voiceC voiceD) {
790   % Bar 1
791   a8    b     c   d     |
792   d4          e         |
793   c16 d e fis d e fis g |
794   a4          a         |
795
796   % Bar 2
797   e8      fis  g     a   |
798   fis4         g         |
799   e16 fis g  a fis g a b |
800   a4           a         |
801
802   % Bar 3 ...
803 }
804
805 \score {
806   \new PianoStaff <<
807      \new Staff {
808        \global
809        <<
810          \relative c'' \voiceA
811          \\
812          \relative c'  \voiceB
813        >>
814      }
815      \new Staff {
816        \global \clef bass
817        <<
818          \relative c \voiceC
819          \\
820          \relative c \voiceD
821        >>
822      }
823   >>
824 }
825 @end lilypond
826
827
828 @seealso
829 Learning Manual:
830 @rlearning{Organizing pieces with variables}.
831
832 Snippets:
833 @rlsr{Simultaneous notes}.