1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. For details, see the Contributors'
7 Guide, node Updating translation committishes..
13 @node Simultaneous notes
14 @section Simultaneous notes
16 @lilypondfile[quote]{simultaneous-headword.ly}
18 Polyphony in music refers to having more than one voice occurring
19 in a piece of music. Polyphony in LilyPond refers to having more
20 than one voice on the same staff.
29 @subsection Single voice
31 This section discusses simultaneous notes inside the same voice.
36 * Simultaneous expressions::
42 @unnumberedsubsubsec Chorded notes
45 @cindex brackets, angle
51 A chord is formed by enclosing a set of pitches between @code{<}
52 and @code{>}. A chord may be followed by a duration just like simple
55 @lilypond[verbatim,quote,relative=2]
56 <a c e>1 <a c e>2 <f a c e>4 <a c>8. <g c e>16
59 Chords may also be followed by articulations, again just like simple
62 @lilypond[verbatim,quote,relative=2]
63 <a c e>1\fermata <a c e>2-> <f a c e>4\prall <a c>8.^| <g c e>16-.
66 The notes within the chord themselves can also be followed by articulation
69 @lilypond[verbatim,quote,relative=2]
70 <a c\prall e>1 <a-> c-^ e>2 <f-. a c-. e-.>4 <a-+ c-->8. <g\fermata c e\turn>16
73 However some notation, such as dynamics, hairpins and slurs must be
74 attached to the chord, rather than notes within the chord, otherwise
77 @lilypond[verbatim,quote,relative=2]
78 <a\f c( e>1 <a c) e>\f <a\< c e>( <a\! c e>) <a c e>\< <a c e> <a c e>\!
81 @cindex relative pitch, chords
82 @cindex chords, relative pitch
84 Relative mode can be used for pitches in chords. The first note of
85 each chord is always relative to the first note of the chord that
86 came before it, or in the case where no preceding chord exists, the
87 pitch of the last note that came before the chord. All remaining notes
88 in the chord are relative to the note that came before it
89 @emph{within the same chord}.
91 @lilypond[verbatim,quote,relative=2]
92 <a c e>1 <f a c> <a c e> <f' a c> <b, e b,>
95 For more information about chords, see @ref{Chord notation}.
102 @rlearning{Combining notes into chords}.
105 @ref{Chord notation},
106 @ref{Articulations and ornamentations},
107 @ref{Relative octave entry},
108 @ref{Multiple voices}.
111 @rlsr{Simultaneous notes}.
114 Chords containing more than two pitches within a staff space,
115 such as @samp{<e f! fis!>}, create overlapping noteheads.
116 Depending on the situation, better representations might involve
121 temporary use of @ref{Multiple voices},
122 @samp{<< f! \\ <e fis!> >>},
125 enharmonic transcription of one or more pitches,
133 @node Chord repetition
134 @unnumberedsubsubsec Chord repetition
136 @cindex Chord, repetiton
137 @cindex repetiton, using @code{q}
139 In order to save typing, a shortcut can be used to repeat the preceding
140 chord. The chord repetition symbol is @code{q}:
142 @lilypond[verbatim,quote,relative=2]
143 <a c e>1 q <f a c>2 q
146 As with regular chords, the chord repetition symbol can be used with
147 durations, articulations, markups, slurs, beams, etc. as only the
148 pitches of the previous chord are duplicated.
150 @lilypond[verbatim,quote,relative=2]
151 <a c e>1\p^"text" q2\<( q8)[-| q8.]\! q16-1-2-3 q8\prall
154 The chord repetition symbol always remembers the last instance of
155 a chord so it is possible to repeat the most recent chord even if
156 other non-chorded notes or rests have been added since.
158 @lilypond[verbatim,quote,relative=2]
162 However, the chord repetition symbol does not retain any dynamics,
163 articulation or ornamentation within, or attached to the previous chord.
165 @lilypond[verbatim,quote,relative=2]
166 <a-. c\prall e>1\sfz c4 q2 r8 q8
171 @ref{Chord notation},
172 @ref{Articulations and ornamentations}.
175 @file{ly/chord-repetition-init.ly}.
178 @node Simultaneous expressions
179 @unnumberedsubsubsec Simultaneous expressions
181 One or more music expressions enclosed in double angle brackets are
182 taken to be simultaneous. If the first expression begins with a
183 single note or if the whole simultaneous expression appears
184 explicitly within a single voice, the whole expression is placed on
185 a single staff; otherwise the elements of the simultaneous
186 expression are placed on separate staves.
188 The following examples show simultaneous expressions on one staff:
190 @lilypond[quote,verbatim,relative=2]
191 \new Voice { % explicit single voice
192 << { a4 b g2 } { d4 g c,2 } >>
196 @lilypond[quote,verbatim,relative=2]
198 a << { a4 b g } { d4 g c, } >>
201 This can be useful if the simultaneous sections have identical
202 rhythms, but attempts to attach notes with different durations
203 to the same stem will cause errors.
205 The following example shows how simultaneous expressions can
206 generate multiple staves implicitly:
208 @lilypond[quote,verbatim,relative=2]
209 % no single first note
210 << { a4 b g2 } { d4 g2 c,4 } >>
213 Here different rhythms cause no problems.
215 @cindex collisions, clashing note columns
216 @cindex collisions, ignoring
219 If notes from two or more voices, with stems in the same direction, are
220 placed at the same position on the staff and have no shift (or have the
221 same shift specified), the message:
224 warning: ignoring too many clashing note columns
227 will appear during compilation. This message can be suppressed by:
230 \override NoteColumn #'ignore-collision = ##t
233 However, this not only suppresses the warning but will prevent any
234 collision resolution whatsover and may have other unintended effects
235 (also see @emph{Known Issues} in @ref{Collision resolution}).
239 @unnumberedsubsubsec Clusters
244 @funindex \makeClusters
245 @funindex makeClusters
247 A cluster indicates a continuous range of pitches to be played.
248 They can be denoted as the envelope of a set of notes. They are
249 entered by applying the function @code{\makeClusters} to a sequence
252 @lilypond[quote,relative=2,verbatim]
253 \makeClusters { <g b>2 <c g'> }
256 Ordinary notes and clusters can be put together in the same staff,
257 even simultaneously. In such a case no attempt is made to
258 automatically avoid collisions between ordinary notes and clusters.
266 @rlsr{Simultaneous notes}.
269 @rinternals{ClusterSpanner},
270 @rinternals{ClusterSpannerBeacon},
271 @rinternals{Cluster_spanner_engraver}.
276 Clusters look good only if they span at least two chords; otherwise
277 they appear too narrow.
279 Clusters do not have a stem and cannot indicate durations by
280 themselves, but the length of the printed cluster is determined by
281 the durations of the defining chords. Separate clusters need a
282 separating rest between them.
284 Clusters do not produce MIDI output.
286 @node Multiple voices
287 @subsection Multiple voices
289 This section discusses simultaneous notes in multiple voices or
293 * Single-staff polyphony::
295 * Collision resolution::
296 * Automatic part combining::
297 * Writing music in parallel::
301 @node Single-staff polyphony
302 @unnumberedsubsubsec Single-staff polyphony
304 @cindex single-staff polyphony
305 @cindex polyphony, single-staff
307 @cindex lyrics assigned to one voice
311 @funindex \voiceOne ... \voiceFour
316 @strong{@i{Explicitly instantiating voices}}
318 The basic structure needed to achieve multiple independent
319 voices in a single staff is illustrated in the following example:
321 @lilypond[quote,relative=3,verbatim]
324 { \voiceOne r8 r16 g e8. f16 g8[ c,] f e16 d }
326 { \voiceTwo d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. }
331 Here, voices are instantiated explicitly and are given names. The
332 @code{\voiceOne} @dots{} @code{\voiceFour} commands set up the voices
333 so that first and third voices get stems up, second and fourth
334 voices get stems down, third and fourth voice note heads are
335 horizontally shifted, and rests in the respective voices are
336 automatically moved to avoid collisions. The @code{\oneVoice}
337 command returns all the voice settings to the neutral default
340 @strong{@i{Temporary polyphonic passages}}
342 A temporary polyphonic passage can be created with the following
346 << @{ \voiceOne ... @}
347 \new Voice @{ \voiceTwo ... @}
352 Here, the first expression within a temporary polyphonic passage is
353 placed into the @code{Voice} context which was in use immediately
354 before the polyphonic passage, and that same @code{Voice} context
355 continues after the temporary section. Other expressions within
356 the angle brackets are assigned to distinct temporary voices.
357 This allows lyrics to be assigned to one continuing voice before,
358 during and after a polyphonic section:
360 @lilypond[quote, verbatim, relative=2]
362 \new Voice = "melody" {
377 \new Lyrics \lyricsto "melody" {
384 Here, the @code{\voiceOne} and @code{\voiceTwo} commands are
385 required to define the settings of each voice.
387 @strong{@i{The double backslash construct}}
389 The @code{<< @{...@} \\ @{...@} >>} construct, where the two (or
390 more) expressions are separated by double backslashes, behaves
391 differently to the similar construct without the double backslashes:
392 @emph{all} the expressions within this construct are assigned
393 to new @code{Voice} contexts. These new @code{Voice} contexts
394 are created implicitly and are given the fixed names @code{"1"},
397 The first example could be typeset as follows:
399 @lilypond[quote,relative=3,verbatim]
401 { r8 r16 g e8. f16 g8[ c,] f e16 d }
403 { d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. }
407 This syntax can be used where it does not matter that temporary
408 voices are created and then discarded. These implicitly created
409 voices are given the settings equivalent to the effect of the
410 @code{\voiceOne} @dots{} @code{\voiceFour} commands, in the order in
411 which they appear in the code.
413 In the following example, the intermediate voice has stems up,
414 therefore we enter it in the third place, so it becomes voice
415 three, which has the stems up as desired. Spacer rests are
416 used to avoid printing doubled rests.
418 @lilypond[quote,relative=3,verbatim]
420 { r8 g g g g f16 ees f8 d }
422 { ees,8 r ees r d r d r }
424 { d'8 s c s bes s a s }
428 In all but the simplest works it is advisable to create explicit
429 @code{Voice} contexts as explained in @rlearning{Contexts and engravers} and
430 @rlearning{Explicitly instantiating voices}.
432 @strong{@i{Voice order}}
434 When entering multiple voices in the input file, use the following
440 Voice 3: second highest
441 Voice 4: second lowest
442 Voice 5: third highest
443 Voice 6: third lowest
447 Though this may seem counterintuitive, it simplifies the automatic
448 layout process. Note that the odd-numbered voices are given
449 upstems, and the even-numbered voices are given downstems:
451 @lilypond[quote,verbatim]
454 { f''2 } % 1: highest
458 { d''2 } % 3: second-highest
460 { e'2 } % 4: second-lowest
462 { b'2 } % 5: third-highest
464 { g'2 } % 6: third-lowest
468 @strong{@i{Identical rhythms}}
470 In the special case that we want to typeset parallel pieces of music
471 that have the same rhythm, we can combine them into a single
472 @code{Voice} context, thus forming chords. To achieve this, enclose
473 them in a simple simultaneous music construct within an explicit voice:
475 @lilypond[quote,relative=2,verbatim]
477 { e4 f8 d e16 f g8 d4 }
478 { c4 d8 b c16 d e8 b4 }
482 This method leads to strange beamings and warnings if the pieces of
483 music do not have the same rhythm.
497 @rlearning{Voices contain music},
498 @rlearning{Explicitly instantiating voices}.
501 @ref{Percussion staves},
502 @ref{Invisible rests},
506 @rlsr{Simultaneous notes}.
510 @unnumberedsubsubsec Voice styles
513 @cindex styles, voice
514 @cindex coloring voices
515 @funindex \voiceOneStyle
516 @funindex \voiceTwoStyle
517 @funindex \voiceThreeStyle
518 @funindex \voiceFourStyle
519 @funindex \voiceNeutralStyle
521 Voices may be given distinct colors and shapes, allowing them to be
524 @lilypond[quote,relative=2,verbatim]
526 { \voiceOneStyle d4 c2 b4 }
528 { \voiceTwoStyle e,2 e }
530 { \voiceThreeStyle b2. c4 }
532 { \voiceFourStyle g'2 g }
536 The @code{\voiceNeutralStyle} command is used to revert to the
537 standard presentation.
541 @code{\voiceOneStyle},
542 @code{\voiceTwoStyle},
543 @code{\voiceThreeStyle},
544 @code{\voiceFourStyle},
545 @code{\voiceNeutralStyle}.
551 @rlearning{I'm hearing Voices},
552 @rlearning{Other sources of information}.
555 @rlsr{Simultaneous notes}.
558 @node Collision resolution
559 @unnumberedsubsubsec Collision resolution
561 @cindex merging notes
562 @cindex note collisions
565 @cindex multiple voices
566 @cindex voices, multiple
567 @cindex polyphonic music
568 @cindex shifting voices
569 @cindex voices, multiple
570 @cindex shift rest, automatic
579 @funindex \mergeDifferentlyDottedOn
580 @funindex mergeDifferentlyDottedOn
581 @funindex \mergeDifferentlyDottedOff
582 @funindex mergeDifferentlyDottedOff
583 @funindex \mergeDifferentlyHeadedOn
584 @funindex mergeDifferentlyHeadedOn
585 @funindex \mergeDifferentlyHeadedOff
586 @funindex mergeDifferentlyHeadedOff
588 The note heads of notes in different voices with the same pitch,
589 same note head and opposite stem direction are automatically
590 merged, but notes with different note heads or the same stem
591 direction are not. Rests opposite a stem in a different voice
592 are shifted vertically. The following example shows three
593 different circumstances, on beats 1 and 3 in bar 1 and beat 1
594 in bar 2, where the automatic merging fails.
596 @lilypond[quote,verbatim,relative=2]
612 Notes with different note heads may be merged, with the
613 exception of half-note heads and quarter-note heads, as shown
614 below. Here the note heads on beat 1 of bar 1 are now merged:
616 @lilypond[quote,verbatim,relative=2]
619 \mergeDifferentlyHeadedOn
633 Note heads with different dots as shown in beat 3 of bar 1 may be
636 @lilypond[quote,relative=2,verbatim]
639 \mergeDifferentlyHeadedOn
640 \mergeDifferentlyDottedOn
654 The half note and eighth note at the start of the second measure
655 are incorrectly merged because the automatic merge cannot
656 successfully complete the merge when three or more notes line up in
657 the same note column, and in this case the merged note head is
658 incorrect. To allow the merge to select the correct note head
659 a @code{\shift} must be applied to the note that should not be
660 merged. Here, @code{\shiftOn} is applied to move the top
661 @notation{g} out of the column, and @code{\mergeDifferentlyHeadedOn}
664 @lilypond[quote,relative=2,verbatim]
667 \mergeDifferentlyHeadedOn
668 \mergeDifferentlyDottedOn
683 The @code{\shiftOn} command allows (but does not force) the notes
684 in a voice to be shifted. When @code{\shiftOn} is applied to a
685 voice, a note or chord in that voice is shifted only if its stem
686 would otherwise collide with a stem from another voice, and only
687 if the colliding stems point in the same direction. The
688 @code{\shiftOff} command prevents this type of shifting from
691 By default, the outer voices (normally voices one and two) have
692 @code{\shiftOff} specified, while the inner voices (three and
693 above) have @code{\shiftOn} specified. When a shift is applied,
694 voices with upstems (odd-numbered voices) are shifted to the
695 right, and voices with downstems (even-numbered voices) are
698 Here is an example to help you visualize how an abbreviated
699 polyphonic expression would be expanded internally.
701 @warning{Note that with three or more voices, the vertical order
702 of voices in your input file should not be the same as the
703 vertical order of voices on the staff!}
705 @lilypond[quote,verbatim]
706 \new Staff \relative c'' {
713 { d'2 } % 3: upper middle
715 { b2 } % 4: lower middle
717 %% internal expansion of the above
719 \new Voice = "1" { \voiceOne \shiftOff f'2 }
720 \new Voice = "2" { \voiceTwo \shiftOff g,2 }
721 \new Voice = "3" { \voiceThree \shiftOn d'2 } % shifts right
722 \new Voice = "4" { \voiceFour \shiftOn b2 } % shifts left
727 Two additional commands, @code{\shiftOnn} and @code{\shiftOnnn}
728 provide further shift levels which may be specified temporarily to
729 resolve collisions in complex situations -- see
730 @rlearning{Real music example}.
732 Notes are only merged if they have opposing stem directions (as
733 they have, for example, in voices one and two by default or when
734 the stems are explicitly set in opposite directions).
737 @code{\mergeDifferentlyDottedOn},
738 @code{\mergeDifferentlyDottedOff},
739 @code{\mergeDifferentlyHeadedOn},
740 @code{\mergeDifferentlyHeadedOff}.
749 @lilypondfile[verbatim,quote,texidoc,doctitle]
750 {additional-voices-to-avoid-collisions.ly}
752 @lilypondfile[verbatim,quote,texidoc,doctitle]
753 {forcing-horizontal-shift-of-notes.ly}
760 @rlearning{Multiple notes at once},
761 @rlearning{Voices contain music},
762 @rlearning{Real music example}.
765 @rlsr{Simultaneous notes}.
768 @rinternals{NoteColumn},
769 @rinternals{NoteCollision},
770 @rinternals{RestCollision}.
772 @cindex collisions, ignoring
775 Using @code{\override NoteColumn #'ignore-collision = ##t} will cause
776 differently headed notes in different voices to merge incorrectly.
778 @lilypond[quote,relative=1,verbatim]
779 \mergeDifferentlyHeadedOn
780 << { c16 a' b a } \\ { c,2 } >>
781 \override NoteColumn #'ignore-collision = ##t
782 << { c16 a' b a } \\ { c,2 } >>
787 @c TODO investigate! Sometimes it works, sometimes not. --FV
788 The requirements for successfully merging different note heads that
789 are at the same time differently dotted are not clear.
792 @node Automatic part combining
793 @unnumberedsubsubsec Automatic part combining
795 @cindex automatic part combining
796 @cindex part combiner
797 @cindex combining parts
800 @funindex \partcombine
801 @funindex partcombine
803 Automatic part combining is used to merge two separate parts of music
804 onto a single staff. This can be especially helpful when typesetting
805 orchestral scores. A single @code{Voice} is printed while the two parts
806 of music are the same, but in places where they differ, a second
807 @code{Voice} is printed. Stem directions are set up & down accordingly
808 while Solo and @notation{a due} parts are also identified and marked
811 The syntax for automatic part combining is:
814 \partcombine @var{musicexpr1} @var{musicexpr2}
817 The following example demonstrates the basic functionality, putting
818 parts on a single staff as polyphony and setting stem directions
819 accordingly. The same variables are used for the independent parts and
822 @lilypond[quote,verbatim]
823 instrumentOne = \relative c' {
831 instrumentTwo = \relative g' {
840 \new Staff \instrumentOne
841 \new Staff \instrumentTwo
842 \new Staff \partcombine \instrumentOne \instrumentTwo
846 Both parts have identical notes in the third measure, so only one
847 instance of the notes is printed. Stem, slur, and tie directions are
848 set automatically, depending on whether the parts are playing solo or in
849 unison. When needed in polyphony situations, the first part (with
850 context called @code{one}) gets @qq{up} stems, while the second (called
851 @code{two}) always gets @qq{down} stems. In solo situations, the first
852 and second parts get marked with @qq{Solo} and @qq{Solo II},
853 respectively. The unison (@notation{a due}) parts are marked with the
856 Both arguments to @code{\partcombine} will be interpreted as separate
857 @code{Voice} contexts, so if the music is being specified in relative
858 mode then @emph{both} parts must contain a @code{\relative} function,
863 \relative @dots{} @var{musicexpr1}
864 \relative @dots{} @var{musicexpr2}
868 A @code{\relative} section that encloses a @code{\partcombine} has no
869 effect on the pitches of @code{@var{musicexpr1}} or
870 @code{@var{musicexpr2}}.
872 @funindex \partcombineChords
873 @funindex partcombineChords
874 @funindex \partcombineApart
875 @funindex partcombineApart
876 @funindex \partcombineUnisono
877 @funindex partcombineUnisono
878 @funindex \partcombineSoloI
879 @funindex partcombineSoloI
880 @funindex \partcombineSoloII
881 @funindex partcombineSoloII
882 @funindex \partcombineAutomatic
883 @funindex partcombineAutomatic
885 In professional scores, voices are often kept apart from each other for
886 long passages of music even if some of the notes are the same in both
887 voices, and could just as easily be printed as unison. Combining notes
888 into a chord, or showing one voice as solo is, therefore, not ideal as
889 the @code{\partcombine} function considers each note separately. In this
890 case the @code{\partcombine} function can be overriden with the
893 Commands ending in @code{...Once} apply only to the next note in the
898 @code{\partcombineApart} and @code{\partcombineApartOnce} keep the
899 notes as two separate voices, even if they can be combined into a chord
903 @code{\partcombineChords} and @code{\partcombineChordsOnce} combine the
907 @code{\partcombineUnisono} and @code{\partcombineUnisonoOnce} combine
908 both voices as @qq{unison}.
911 @code{\partcombineSoloI} and @code{\partcombineSoloIOnce} print only
912 voice one, and mark it as a @qq{Solo}.
915 @code{\partcombineSoloII} or @code{\partcombineSoloIIOnce} print only
916 voice two and mark it as a @qq{Solo}.
919 @code{\partcombineAutomatic} and @code{\partcombineAutomaticOnce} end
920 the functions of the commands above, and revert back to the standard
921 @code{\partcombine} functionality.
924 @lilypond[quote,verbatim]
925 instrumentOne = \relative c' {
926 \partcombineApart c2^"apart" e |
927 \partcombineAutomatic e2^"auto" e |
928 \partcombineChords e'2^"chord" e |
929 \partcombineAutomatic c2^"auto" c |
930 \partcombineApart c2^"apart" \partcombineChordsOnce e^"chord once" |
933 instrumentTwo = \relative c' {
943 \new Staff { \instrumentOne }
944 \new Staff { \instrumentTwo }
945 \new Staff { \partcombine \instrumentOne \instrumentTwo }
952 @lilypondfile[verbatim,quote,texidoc,doctitle]
953 {combining-two-parts-on-the-same-staff.ly}
955 @lilypondfile[verbatim,quote,texidoc,doctitle]
956 {changing-partcombine-texts.ly}
968 @rlsr{Simultaneous notes}.
971 @rinternals{PartCombineMusic},
976 All @code{\partcombine...} functions can only accept two voices and are
977 not designed to work with lyrics; such that when one of the voices is
978 explicitly named in order to attach lyrics to it, the partcombiner will
981 @code{\partcombine...} functions cannot be placed inside a @code{\times}
982 or @code{\relative} block.
984 If @code{printPartCombineTexts} is set and the two voices play the same
985 notes @qq{on and off}, in the same measure, the part combiner may
986 typeset @code{a2} more than once in that measure.
988 @code{\partcombine} only knows when a note starts in a @code{Voice}; it
989 cannot, for example, remember if a note in one @code{Voice} has already
990 started when combining notes that have just started in the other
991 @code{Voice}. This can lead to a number of unexpected issues including
992 @qq{Solo} or @qq{Unison} marks being printed incorrectly.
994 @code{\partcombine} keeps all spanners (slurs, ties, hairpins etc.) in
995 the same @code{Voice} so that if any such spanners start or end in a
996 different @code{Voice}, they may not be printed properly or at all.
998 If the @code{\partcombine} function cannot combine both music
999 expressions (i.e. when both voices have different durations), it will
1000 give the voices, internally, its own custom names: @code{one} and
1001 @code{two} respectively. This means if there is any @qq{switch} to a
1002 differently named @code{Voice} context, the events in that differently
1003 named @code{Voice} will be ignored.
1005 Refer also to @emph{Known issues and warnings} when using
1006 @code{\partcombine} with tablature in @ref{Default tablatures} and the
1007 @emph{Note} in @ref{Automatic beams} when using automatic beaming.
1010 @node Writing music in parallel
1011 @unnumberedsubsubsec Writing music in parallel
1013 @cindex writing music in parallel
1014 @cindex interleaved music
1015 @cindex parallel music
1016 @funindex \parallelMusic
1017 @funindex parallelMusic
1019 Music for multiple parts can be interleaved in input code. The
1020 function @code{\parallelMusic} accepts a list with the names of a
1021 number of variables to be created, and a musical expression. The
1022 content of alternate measures from the expression become the value
1023 of the respective variables, so you can use them afterwards to
1026 @warning{Bar checks @code{|} must be used, and the measures must
1027 be of the same length.}
1029 @lilypond[quote,verbatim]
1030 \parallelMusic #'(voiceA voiceB voiceC) {
1032 r8 g'16 c'' e'' g' c'' e'' r8 g'16 c'' e'' g' c'' e'' |
1033 r16 e'8.~ e'4 r16 e'8.~ e'4 |
1037 r8 a'16 d'' f'' a' d'' f'' r8 a'16 d'' f'' a' d'' f'' |
1038 r16 d'8.~ d'4 r16 d'8.~ d'4 |
1043 \new Staff << \voiceA \\ \voiceB >>
1044 \new Staff { \clef bass \voiceC }
1048 Relative mode may be used. Note that the @code{\relative} command
1049 is not used inside @code{\parallelMusic} itself. The notes are
1050 relative to the preceding note in the voice, not to the previous
1051 note in the input -- in other words, relative notes for
1052 @code{voiceA} ignore the notes in @code{voiceB}.
1054 @lilypond[quote,verbatim]
1055 \parallelMusic #'(voiceA voiceB voiceC) {
1057 r8 g16 c e g, c e r8 g,16 c e g, c e |
1058 r16 e8.~ e4 r16 e8.~ e4 |
1062 r8 a,16 d f a, d f r8 a,16 d f a, d f |
1063 r16 d8.~ d4 r16 d8.~ d4 |
1068 \new Staff << \relative c'' \voiceA \\ \relative c' \voiceB >>
1069 \new Staff \relative c' { \clef bass \voiceC }
1073 This works quite well for piano music. This example maps four
1074 consecutive measures to four variables:
1076 @lilypond[quote,verbatim]
1082 \parallelMusic #'(voiceA voiceB voiceC voiceD) {
1086 c16 d e fis d e fis g |
1092 e16 fis g a fis g a b |
1103 \relative c'' \voiceA
1105 \relative c' \voiceB
1123 @rlearning{Organizing pieces with variables}.
1126 @rlsr{Simultaneous notes}.