Collision Resolution - GNU LilyPond
Description: GNU LilyPond

Previous: Explicitly instantiating voices, Up: Polyphony

#### 6.6.3 Collision Resolution

Normally, note heads with a different number of dots are not merged, but when the object property `merge-differently-dotted` is set in the NoteCollision object, they are merged

>          \new Voice << {
>            g8 g8
>            \override Staff.NoteCollision
>              #'merge-differently-dotted = ##t
>            g8 g8
>          } \\ { g8.[ f16] g8.[ f16] } >>

Similarly, you can merge half note heads with eighth notes, by setting `merge-differently-headed`

>          \new Voice << {
>            c8 c4.
>            \override Staff.NoteCollision
>              #'merge-differently-headed = ##t
>          c8 c4. } \\ { c2 c2 } >>

LilyPond also vertically shifts rests that are opposite of a stem, for example

>          \new Voice << c''4 \\ r4 >>

##### Predefined commands

`\oneVoice`, `\voiceOne`, `\voiceTwo`, `\voiceThree`, `\voiceFour`.

`\shiftOn`, `\shiftOnn`, `\shiftOnnn`, `\shiftOff`: these commands specify in what chords of the current voice should be shifted. The outer voices (normally: voice one and two) have `\shiftOff`, while the inner voices (three and four) have `\shiftOn`. `\shiftOnn` and `\shiftOnnn` define further shift levels.

When LilyPond cannot cope, the `force-hshift` property of the NoteColumn object and pitched rests can be used to override typesetting decisions.

>          \relative <<
>          {
>            <d g>
>            <d g>
>          } \\ {
>            <b f'>
>            \once \override NoteColumn #'force-hshift = #1.7
>            <b f'>
>          } >>

##### See also

Program reference: the objects responsible for resolving collisions are NoteCollision and RestCollision.

Examples: `input/regression/collision-dots.ly`, `input/regression/collision-head-chords.ly`, `input/regression/collision-heads.ly`, `input/regression/collision-mesh.ly`, and `input/regression/collisions.ly`.

##### Bugs

When using `merge-differently-headed` with an upstem eighth or a shorter note, and a downstem half note, the eighth note gets the wrong offset.

There is no support for clusters where the same note occurs with different accidentals in the same chord. In this case, it is recommended to use enharmonic transcription, or to use special cluster notation (see Clusters).

This page is for LilyPond-2.8.8 (stable-branch).

Other languages: English.
Using automatic language selection.