Combine noteheads of different values in Lilypond

I’ve been recently typesetting some classical guitar notation into Lilypond and wanting to get as close to the original as possible I noticed that Lilypond was handling doubled notes with different values incorrectly (for my purposes).

Here is some example code to demonstrate what I mean:

\relative c”{
<<{ g8 c g c g2 }
\\{ g4. c8 g2 }>>
}

Produces:

lilyex1




To get around this use the “Staff.NoteCollision” command like this:

\relative c”{
\override Staff.NoteCollision #’merge-differently-dotted = ##t
<<{ g8 c g c g2 }
\\{ g4. c8 g2 }>>
}

And the resulting output:

lilyex2




Please note: this is how it works on my Lilypond which is an older version (2.10.33) which ships with Ubuntu 8.10. If you are using the newest stable version (2.12.1) the command looks a little different:

\relative c”{
\mergeDifferentlyDottedOn
<<{ g8 c g c g2 }
\\{ g4. c8 g2 }>>
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>