Dead notes in tablature now work with any font

The current stable version of LilyPond (2.18.2) has a pretty annoying limitation for tablature users. If you change the TabStaff font to something different from the default (Feta) and your score contains dead notes, you won’t see any symbol on the TabStaff, because the font you chose probably does not have a cross glyph. So, at least in these scores, you are forced to use Feta (a serif font) also for tablature. This implies that you may not be able to write a tablature book in sans serif font or you’ll have to sacrifice consistency. This was the case for a project of mine, where all the pieces without dead notes used a sans serif font, but I had to use serif in those pieces where dead notes were present. Fortunately this has been fixed in development version 2.19.55, released this week. Now my book project will have consistent font settings! Let’s see a simple example.

Dead notes are represented by an X glyph printed either on a Staff or a TabStaff. The predefined commands are \xNote, \xNotesOn, \xNotesOff (and their synonyms \deadNote, \deadNotesOn, \deadNotesOff). If we change the tablature font to another font (e.g. Nimbus Sans) and compile the following snippet in version 2.18.2:

\version "2.18.2"
%\version "2.19.55"

myMusic = \relative {
  \override TabNoteHead.font-name = #"Nimbus Sans L Bold"
  \xNote { c4 e f a }
  <c g e c>1

\score {
  \new StaffGroup <<
    \new Staff { \clef "treble_8" \myMusic }
    \new TabStaff { \clef "moderntab" \new TabVoice \myMusic }
  \layout {
    indent = 0
    \context {
      \omit StringNumber

we get the following warning for each note within the \xNote block:

warning: none of note heads `noteheads.s' or `noteheads.u' found

And the output will be the following (note the empty first measure in the TabStaff):

no dead notes in tablature

Version 2.18: no dead notes on tablature staves (if a custom font for tablature is set)

If you compile the same snippet with version 2.19.55 or any later version, you’ll see the cross glyphs in the first measure of tablature:

correct dead notes on tablature

Version 2.19.55 or later: the X glyphs of dead notes are correctly printed on tablature staves

For those interested in how this was technically achieved – as explained by Harm on issue 4931 – it is done by temporarily setting font-name to '(), causing the default font (usually Feta) to take over, and then reverting this later.
This is an important bugfix for all tablature users who want to use a custom font for tablature numbers and care for graphical consistency in their projects. Kudos to Harm!

Leave a Reply

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