[icon]

GNU LilyPond

-- --

What is LilyPond
Home
Examples
Templates
Download
GNU/Linux binaries
Windows binaries
Source code
Documentation
Tutorial
Manual
Glossary
Index

Support
Mailing lists
Search
WikiWiki

External sites
lilypond.org/stable
lilypond.org/development
savannah.gnu.org
ftp.lilypond.org
Mutopia
Other music online

Automatic part combining

Automatic part combining is used to merge two parts of music onto a staff in an intelligent way. It is aimed primarily at typesetting orchestral scores. When the two parts are identical for a period of time, only one is shown. In places where the two parts differ, they are typeset as separate voices, and stem directions are set automatically. Also, solo and a due parts can be identified and marked.

The syntax for part combining is

       \partcombine context musicexpr1 musicexpr2
     
where the pieces of music musicexpr1 and musicexpr2 will be combined into one context of type context. The music expressions must be interpreted by contexts whose names should start with one and two.

The most useful function of the part combiner is to combine parts into one voice, as common for wind parts in orchestral scores:

       \context Staff <
         \context Voice=one \partcombine Voice
           \context Thread=one \relative c'' {
             g a () b r
           }
           \context Thread=two \relative c'' {
             g r4 r f
           }
       >
     
[picture of music]

Notice that the first g appears only once, although it was specified twice (once in each part). Stem, slur and tie directions are set automatically, depending whether there is a solo or unisono. The first part (with context called one) always gets up stems, and `solo', while the second (called two) always gets down stems and `Solo II'.

If you just want the merging parts, and not the textual markings, you may set the property soloADue to false.

       \context Staff <
         \property Staff.soloADue = ##f
         \context Voice=one \partcombine Voice
           \context Thread=one \relative c'' {
             b4 a c g
           }
           \context Thread=two \relative c'' {
             d,2 a4 g'
           }
       >
     
[picture of music]

There are a number of other properties that you can use to tweak the behavior of part combining, refer to the automatically generated documentation of Thread_devnull_engraver and Voice_devnull_engraver . Look at the documentation of the responsible engravers, Thread_devnull_engraver, Voice_devnull_engraver and A2_engraver.

BUGS

In soloADue mode, when the two voices play the same notes on and off, the part combiner may typeset a2 more than once in a measure.

[picture of music]
Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to (address unknown)

Copyright (c) 1997--2002 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.7.14 (development-branch) by

Buchan Milne <(address unknown)>, Thu Mar 6 21:11:35 2003 CET.