Alternate accidental glyphs

Non-Western and ancient notation systems have their own accidentals. The glyphs are controlled through the alterationGlyphs property of the Staff context and similar context types. The predefined values for this property are listed in Accidental glyph sets.

\layout {
  \context {
    \Staff
    alterationGlyphs = #alteration-vaticana-glyph-name-alist
  }
}

{ ces' c' cis' }

[image of music]

The property may also be set to a custom associative list mapping alterations to glyph names. Alterations are given as fractions in tones. Glyphs are listed at Accidental glyphs.

\layout {
  \context {
    \Staff
    alterationGlyphs =
      #'((-1/2 . "accidentals.flat.arrowdown")
         (0 . "accidentals.natural.arrowup")
         (1/2 . "accidentals.sharp.arrowup"))
  }
}

{ ces' c' cis' }

[image of music]

The padding-pairs property of KeySignature and KeyCancellation objects is an associative list mapping pairs of glyphs to the padding that should be added between these glyphs in key signatures.

\layout {
  \context {
    \Staff
    alterationGlyphs =
      #'((-1/2 . "accidentals.flat.arrowdown")
         (0 . "accidentals.natural.arrowup")
         (1/2 . "accidentals.sharp.arrowup"))
    \override KeySignature.padding-pairs =
      #'((("accidentals.sharp.arrowup" . "accidentals.sharp.arrowup")
            . 0.25)
         (("accidentals.flat.arrowdown" . "accidentals.flat.arrowdown")
            . 0.3))
    \override KeyCancellation.padding-pairs =
      #'((("accidentals.natural.arrowup" . "accidentals.natural.arrowup")
            . 0.7))
  }
}

{
  \key cis \major
  ces' c'
  \key ces \major
  cis'
}

[image of music]

See also

Notation Reference: Accidental glyph sets, Accidental glyphs.

Internals Reference: accidental-switch-interface, Alteration_glyph_engraver, key-signature-interface.


LilyPond Notation Reference v2.25.21 (development-branch).