#### 3.14.8 Automatic part combining

Automatic part combining is used to merge two parts of music onto a staff. It is aimed 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 are identified and can be marked.

The syntax for part combining is

           \partcombine musicexpr1 musicexpr2

The music expressions will be interpreted as Voice contexts. If using relative octaves, `\relative` should be specified for both music expressions, i.e.

         \partcombine \relative ...  musicexpr1
           \relative ... musicexpr2

A `\relative` section that is outside of `\partcombine` has no effect on the pitches of musicexpr1 and musicexpr2.

The following example demonstrates the basic functionality of the part combiner: putting parts on one staff, and setting stem directions and polyphony

>          \new Staff \partcombine
>            \relative g' { g g a( b) c c r r }
>            \relative g' { g g r4 r e e g g }

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

>          \new Staff <<
>            \set Staff.soloADue = ##f
>            \partcombine
>              \relative g' { g a( b) r }
>              \relative g' { g r4 r f }
>          >>

##### See also

Program reference: PartCombineMusic, SoloOneEvent, and SoloTwoEvent, and UnisonoEvent.

##### 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.

`\partcombine` cannot be inside `\times`.

`\partcombine` cannot be inside `\relative`.

Internally, the `\partcombine` interprets both arguments as `Voice`s named `one` and `two`, and then decides when the parts can be combined. Consequently, if the arguments switch to differently named Voice contexts, the events in those will be ignored.

Read comments on this page, or add one. This page is for LilyPond-2.2.2 (stable-branch).