]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/simultaneous.itely
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[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 @noindent
212 Here, voices are instantiated explicitly and are given names. The
213 @code{\voiceOne} ... @code{\voiceFour} commands set up the voices
214 so that first and third voices get stems up, second and fourth
215 voices get stems down, third and fourth voice note heads are
216 horizontally shifted, and rests in the respective voices are
217 automatically moved to avoid collisions.  The @code{\oneVoice}
218 command returns all the voice settings to the neutral default
219 directions.
220
221 @strong{@i{Temporary polyphonic passages}}
222
223 A temporary polyphonic passage can be created with the following
224 construct:
225
226 @example
227 << @{ \voiceOne ... @}
228   \new Voice @{ \voiceTwo ... @}
229 >> \oneVoice
230 @end example
231
232 @noindent
233 Here, the first expression within a temporary polyphonic passage is
234 placed into the @code{Voice} context which was in use immediately
235 before the polyphonic passage, and that same @code{Voice} context
236 continues after the temporary section.  Other expressions within
237 the angle brackets are assigned to distinct temporary voices.
238 This allows lyrics to be assigned to one continuing voice before,
239 during and after a polyphonic section:
240
241 @lilypond[quote, verbatim, relative=2]
242 <<
243   \new Voice = "melody" {
244     a4
245     <<
246       {
247         \voiceOne
248         g f
249       }
250       \new Voice {
251         \voiceTwo
252         d2
253       }
254     >>
255     \oneVoice
256     e4
257   }
258   \new Lyrics \lyricsto "melody" {
259   This is my song.
260   }
261 >>
262 @end lilypond
263
264 @noindent
265 Here, the @code{\voiceOne} and @code{\voiceTwo} commands are
266 required to define the settings of each voice.
267
268 @strong{@i{The double backslash construct}}
269
270 The @code{<< @{...@} \\ @{...@} >>} construct, where the two (or
271 more) expressions are separated by double backslashes, behaves
272 differently to the similar construct without the double backslashes:
273 @emph{all} the expressions within this contruct are assigned
274 to new @code{Voice} contexts.  These new @code{Voice} contexts
275 are created implicitly and are given the fixed names @code{"1"},
276 @code{"2"}, etc.
277
278 The first example could be typeset as follows:
279
280 @lilypond[quote,relative=3,verbatim]
281 <<
282   { r8 r16 g e8. f16 g8[ c,] f e16 d }
283   \\
284   { d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. }
285 >>
286 @end lilypond
287
288 This syntax can be used where it does not matter that temporary
289 voices are created and then discarded.  These implicitly created
290 voices are given the settings equivalent to the effect of the
291 @code{\voiceOne} ... @code{\voiceFour} commands, in the order in
292 which they appear in the code.
293
294 In the following example, the intermediate voice has stems up,
295 therefore we enter it in the third place, so it becomes voice
296 three, which has the stems up as desired.  Spacer rests are
297 used to avoid printing doubled rests.
298
299 @lilypond[quote,relative=3,verbatim]
300 <<
301   { r8 g g  g g f16 ees f8 d }
302   \\
303   { ees,8 r ees r d r d r }
304   \\
305   { d'8 s c s bes s a s }
306 >>
307 @end lilypond
308
309 In all but the simplest works it is advisable to create explicit
310 @code{Voice} contexts as explained in @rlearning{Contexts and engravers} and
311 @rlearning{Explicitly instantiating voices}.
312
313 @strong{@i{Identical rhythms}}
314
315 In the special case that we want to typeset parallel pieces of music
316 that have the same rhythm, we can combine them into a single
317 @code{Voice} context, thus forming chords.  To achieve this, enclose
318 them in a simple simultaneous music construct within an explicit voice:
319
320 @lilypond[quote,relative=2,verbatim]
321 \new Voice <<
322   { e4 f8 d e16 f g8 d4 }
323   { c4 d8 b c16 d e8 b4 }
324 >>
325 @end lilypond
326
327 This method leads to strange beamings and warnings if the pieces of
328 music do not have the same rhythm.
329
330
331 @predefined
332 @code{\voiceOne},
333 @code{\voiceTwo},
334 @code{\voiceThree},
335 @code{\voiceFour},
336 @code{\oneVoice}.
337 @endpredefined
338
339
340 @seealso
341 Learning Manual:
342 @rlearning{Voices contain music},
343 @rlearning{Explicitly instantiating voices}.
344
345 Notation Reference:
346 @ref{Percussion staves},
347 @ref{Invisible rests},
348 @ref{Stems}.
349
350 Snippets:
351 @rlsr{Simultaneous notes}.
352
353
354 @node Voice styles
355 @unnumberedsubsubsec Voice styles
356
357 @cindex voice styles
358 @cindex styles, voice
359 @cindex coloring voices
360 @funindex \voiceOneStyle
361 @funindex \voiceTwoStyle
362 @funindex \voiceThreeStyle
363 @funindex \voiceFourStyle
364 @funindex \voiceNeutralStyle
365
366 Voices may be given distinct colors and shapes, allowing them to be
367 easily identified:
368
369 @lilypond[quote,relative=2,verbatim]
370 <<
371   { \voiceOneStyle d4 c2 b4 }
372   \\
373   { \voiceTwoStyle e,2 e }
374   \\
375   { \voiceThreeStyle b2. c4 }
376   \\
377   { \voiceFourStyle g'2 g }
378 >>
379 @end lilypond
380
381 The @code{\voiceNeutralstyle} command is used to revert to the
382 standard presentation.
383
384
385 @predefined
386 @code{\voiceOneStyle},
387 @code{\voiceTwoStyle},
388 @code{\voiceThreeStyle},
389 @code{\voiceFourStyle},
390 @code{\voiceNeutralStyle}.
391 @endpredefined
392
393
394 @seealso
395 Learning Manual:
396 @rlearning{I'm hearing Voices},
397 @rlearning{Other sources of information}.
398
399 Snippets:
400 @rlsr{Simultaneous notes}.
401
402
403 @node Collision resolution
404 @unnumberedsubsubsec Collision resolution
405
406 @cindex merging notes
407 @cindex note collisions
408 @cindex collisions
409 @cindex shift note
410 @cindex multiple voices
411 @cindex voices, multiple
412 @cindex polyphonic music
413 @cindex shifting voices
414 @cindex voices, multiple
415 @cindex shift rest, automatic
416 @funindex \shiftOn
417 @funindex shiftOn
418 @funindex \shiftOnn
419 @funindex shiftOnn
420 @funindex \shiftOnnn
421 @funindex shiftOnnn
422 @funindex \shiftOff
423 @funindex shiftOff
424 @funindex \mergeDifferentlyDottedOn
425 @funindex mergeDifferentlyDottedOn
426 @funindex \mergeDifferentlyDottedOff
427 @funindex mergeDifferentlyDottedOff
428 @funindex \mergeDifferentlyHeadedOn
429 @funindex mergeDifferentlyHeadedOn
430 @funindex \mergeDifferentlyHeadedOff
431 @funindex mergeDifferentlyHeadedOff
432
433 The note heads of notes in different voices with the same pitch,
434 same note head and opposite stem direction are automatically
435 merged, but notes with different note heads or the same stem
436 direction are not.  Rests opposite a stem in a different voice
437 are shifted vertically.
438
439 @lilypond[quote,verbatim,relative=2]
440 <<
441   {
442     c8 d e d c d c4
443     g'2 fis
444   } \\ {
445     c2 c8. b16 c4
446     e,2 r
447   } \\ {
448     \oneVoice
449     s1
450     e8 a b c d2
451   }
452 >>
453 @end lilypond
454
455 Notes with different note heads may be merged, with the
456 exception of half-note heads and quarter-note heads:
457
458 @lilypond[quote,verbatim,relative=2]
459 <<
460   {
461     \mergeDifferentlyHeadedOn
462     c8 d e d c d c4
463     g'2 fis
464   } \\ {
465     c2 c8. b16 c4
466     e,2 r
467   } \\ {
468     \oneVoice
469     s1
470     e8 a b c d2
471   }
472 >>
473 @end lilypond
474
475 Note heads with different dots may be merged:
476
477 @lilypond[quote,relative=2,verbatim]
478 <<
479   {
480     \mergeDifferentlyHeadedOn
481     \mergeDifferentlyDottedOn
482     c8 d e d c d c4
483     g'2 fis
484   } \\ {
485     c2 c8. b16 c4
486     e,2 r
487   } \\ {
488     \oneVoice
489     s1
490     e8 a b c d2
491   }
492 >>
493 @end lilypond
494
495
496 The half note and eighth note at the start of the second measure
497 are incorrectly merged because @code{\mergeDifferentlyHeadedOn}
498 cannot successfully complete the merge when three or more notes
499 line up in the same column, and in this case a warning is given.
500 To allow the merge to work properly a @code{\shift} must be applied
501 to the note that should not be merged.  Here, @code{\shiftOn} is
502 applied to move the top @notation{g} out of the column, and
503 @code{\mergeDifferentlyHeadedOn} then works properly.
504
505 @lilypond[quote,relative=2,verbatim]
506 <<
507   {
508     \mergeDifferentlyHeadedOn
509     \mergeDifferentlyDottedOn
510     c8 d e d c d c4
511     \shiftOn
512     g'2 fis
513   } \\ {
514     c2 c8. b16 c4
515     e,2 r
516   } \\ {
517     \oneVoice
518     s1
519     e8 a b c d2
520   }
521
522 >>
523 @end lilypond
524
525 The @code{\shiftOn}, @code{\shiftOnn}, and @code{\shiftOnnn}
526 commands specify the degree to which chords of the current voice
527 should be shifted.  The outer voices (normally: voices one and
528 two) have @code{\shiftOff}, while the inner voices (three and
529 four) have @code{\shiftOn}.  @code{\shiftOnn} and
530 @code{\shiftOnnn} define further shift levels.
531
532 Notes are only merged if they have opposing stem directions (e.g. in
533 @code{Voice} 1 and 2).
534
535
536 @predefined
537 @code{\mergeDifferentlyDottedOn},
538 @code{\mergeDifferentlyDottedOff},
539 @code{\mergeDifferentlyHeadedOn},
540 @code{\mergeDifferentlyHeadedOff}.
541
542 @code{\shiftOn},
543 @code{\shiftOnn},
544 @code{\shiftOnnn},
545 @code{\shiftOff}.
546 @endpredefined
547
548
549 @snippets
550
551 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
552 {additional-voices-to-avoid-collisions.ly}
553
554 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
555 {forcing-horizontal-shift-of-notes.ly}
556
557
558 @seealso
559 Music Glossary:
560 @rglos{polyphony}.
561
562 Learning Manual:
563 @rlearning{Multiple notes at once},
564 @rlearning{Voices contain music},
565 @rlearning{Collisions of objects}.
566
567 Snippets:
568 @rlsr{Simultaneous notes}.
569
570 Internals Reference:
571 @rinternals{NoteColumn},
572 @rinternals{NoteCollision},
573 @rinternals{RestCollision}.
574
575
576 @knownissues
577
578 @ignore
579 @c TODO investigate! Sometimes it works, sometimes not. --FV
580 The requirements for successfully merging different note heads that
581 are at the same time differently dotted are not clear.
582 @end ignore
583
584 There is no support for chords where the same note occurs with
585 different accidentals in the same chord.  In this case, it is
586 recommended to use enharmonic transcription, or to use special
587 cluster notation (see @ref{Clusters}).
588
589
590 @node Automatic part combining
591 @unnumberedsubsubsec Automatic part combining
592
593 @cindex automatic part combining
594 @cindex part combiner
595 @cindex combining parts
596 @cindex a due part
597 @cindex solo part
598 @funindex \partcombine
599 @funindex partcombine
600
601 Automatic part combining is used to merge two parts of music onto
602 a staff.  It is aimed at typesetting orchestral scores.  When the
603 two parts are identical for a period of time, only one is shown.
604 In places where the two parts differ, they are typeset as separate
605 voices, and stem directions are set automatically.  Also, solo and
606 @notation{a due} parts are identified and marked by default.
607
608 The syntax for part combining is:
609
610 @example
611 \partcombine @var{musicexpr1} @var{musicexpr2}
612 @end example
613
614 The following example demonstrates the basic functionality of the
615 part combiner: putting parts on one staff and setting stem
616 directions and polyphony.  The same variables are used for the
617 independent parts and the combined staff.
618
619 @lilypond[quote,verbatim]
620 instrumentOne = \relative c' {
621   c4 d e f
622   R1
623   d'4 c b a
624   b4 g2 f4
625   e1
626 }
627
628 instrumentTwo = \relative g' {
629   R1
630   g4 a b c
631   d c b a
632   g f( e) d
633   e1
634 }
635
636 <<
637   \new Staff \instrumentOne
638   \new Staff \instrumentTwo
639   \new Staff \partcombine \instrumentOne \instrumentTwo
640 >>
641 @end lilypond
642
643 The notes in the third measure appear only once, although they were
644 specified in both parts.  Stem, slur, and tie directions are set
645 automatically, depending whether there is a solo or unison.  When
646 needed in polyphony situations, the first part (with context called
647 @code{one}) always gets up stems, while the second (called @code{two})
648 always gets down stems.  In solo situations, the first and second
649 parts get marked with @q{Solo} and @q{Solo II}, respectively.  The
650 unisono (@notation{a due}) parts are marked by default with the text
651 @qq{a2}.
652
653 Both arguments to @code{\partcombine} will be interpreted as
654 @code{Voice} contexts.  If using relative octaves,
655 @code{\relative} should be specified for both music expressions,
656 i.e.,
657
658 @example
659 \partcombine
660   \relative @dots{} @var{musicexpr1}
661   \relative @dots{} @var{musicexpr2}
662 @end example
663
664 @noindent
665 A @code{\relative} section that is outside of @code{\partcombine}
666 has no effect on the pitches of @var{musicexpr1} and
667 @var{musicexpr2}.
668
669 @snippets
670
671 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
672 {combining-two-parts-on-the-same-staff.ly}
673
674 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
675 {changing-partcombine-texts.ly}
676
677
678 @seealso
679 Music Glossary:
680 @rglos{a due},
681 @rglos{part}.
682
683 Notation Reference:
684 @ref{Writing parts}.
685
686 Snippets:
687 @rlsr{Simultaneous notes}.
688
689 Internals Reference:
690 @rinternals{PartCombineMusic},
691 @rinternals{Voice}.
692
693
694 @knownissues
695
696 @code{\partcombine} can only accept two voices.
697
698 When @code{printPartCombineTexts} is set, if the two voices play
699 the same notes on and off, the part combiner may typeset @code{a2}
700 more than once in a measure.
701
702 @code{\partcombine} cannot be inside @code{\times}.
703
704 @code{\partcombine} cannot be inside @code{\relative}.
705
706 Internally, the @code{\partcombine} interprets both arguments as
707 @code{Voice}s and decides when the parts can be combined.  When they have
708 different durations they cannot be combined and are given the names
709 @code{one} and @code{two}.  Consequently, if the arguments switch to
710 differently named @rinternals{Voice} contexts, the events in those will
711 be ignored.  Likewise, partcombining isn't designed to work with lyrics;
712 when one of the voices is explicitly named in order to attach lyrics to
713 it, the partcombining stops working.
714
715 @code{\partcombine} only observes onset times of notes. It cannot
716 determine whether a previously started note is playing or not, leading
717 to various problems.
718
719
720 @node Writing music in parallel
721 @unnumberedsubsubsec Writing music in parallel
722
723 @cindex writing music in parallel
724 @cindex interleaved music
725 @cindex parallel music
726 @funindex \parallelMusic
727 @funindex parallelMusic
728
729 Music for multiple parts can be interleaved in input code.  The
730 function @code{\parallelMusic} accepts a list with the names of a
731 number of variables to be created, and a musical expression.  The
732 content of alternate measures from the expression become the value
733 of the respective variables, so you can use them afterwards to
734 print the music.
735
736 @warning{Bar checks @code{|} must be used, and the measures must
737 be of the same length.}
738
739 @lilypond[quote,verbatim]
740 \parallelMusic #'(voiceA voiceB voiceC) {
741   % Bar 1
742   r8 g'16 c'' e'' g' c'' e'' r8 g'16 c'' e'' g' c'' e'' |
743   r16 e'8.~   e'4            r16 e'8.~   e'4            |
744   c'2                        c'2                        |
745
746   % Bar 2
747   r8 a'16 d'' f'' a' d'' f'' r8 a'16 d'' f'' a' d'' f'' |
748   r16 d'8.~   d'4            r16 d'8.~   d'4            |
749   c'2                        c'2                        |
750
751 }
752 \new StaffGroup <<
753   \new Staff << \voiceA \\ \voiceB >>
754   \new Staff { \clef bass \voiceC }
755 >>
756 @end lilypond
757
758 Relative mode may be used.  Note that the @code{\relative} command
759 is not used inside @code{\parallelMusic} itself.  The notes are
760 relative to the preceding note in the voice, not to the previous
761 note in the input -- in other words, relative notes for
762 @code{voiceA} ignore the notes in @code{voiceB}.
763
764 @lilypond[quote,verbatim]
765 \parallelMusic #'(voiceA voiceB voiceC) {
766   % Bar 1
767   r8 g16 c e g, c e r8 g,16 c e g, c e  |
768   r16 e8.~ e4       r16 e8.~  e4        |
769   c2                c                   |
770
771   % Bar 2
772   r8 a,16 d f a, d f r8 a,16 d f a, d f |
773   r16 d8.~  d4       r16 d8.~  d4       |
774   c2                 c                  |
775
776  }
777 \new StaffGroup <<
778   \new Staff << \relative c'' \voiceA \\ \relative c' \voiceB >>
779   \new Staff \relative c' { \clef bass \voiceC }
780 >>
781 @end lilypond
782
783 This works quite well for piano music.  This example maps four
784 consecutive measures to four variables:
785
786 @lilypond[quote,verbatim]
787 global = {
788   \key g \major
789   \time 2/4
790 }
791
792 \parallelMusic #'(voiceA voiceB voiceC voiceD) {
793   % Bar 1
794   a8    b     c   d     |
795   d4          e         |
796   c16 d e fis d e fis g |
797   a4          a         |
798
799   % Bar 2
800   e8      fis  g     a   |
801   fis4         g         |
802   e16 fis g  a fis g a b |
803   a4           a         |
804
805   % Bar 3 ...
806 }
807
808 \score {
809   \new PianoStaff <<
810      \new Staff {
811        \global
812        <<
813          \relative c'' \voiceA
814          \\
815          \relative c'  \voiceB
816        >>
817      }
818      \new Staff {
819        \global \clef bass
820        <<
821          \relative c \voiceC
822          \\
823          \relative c \voiceD
824        >>
825      }
826   >>
827 }
828 @end lilypond
829
830
831 @seealso
832 Learning Manual:
833 @rlearning{Organizing pieces with variables}.
834
835 Snippets:
836 @rlsr{Simultaneous notes}.