Jump to content

Adding accidentals to a trillspanner: Difference between revisions

From LilyPond wiki
No edit summary
m New category
 
Line 23: Line 23:
[[Category:Pitches]]
[[Category:Pitches]]
[[Category:Version-specific]]
[[Category:Version-specific]]
[[Category:Workaround]][[Category:Snippet]]
[[Category:Workaround]]
[[Category:Snippet]]

Latest revision as of 23:12, 21 November 2025

By overriding bound-details, you can insert an accidental after the trill sign in a trillspanner. However, this can look ugly since the accidental isn't aligned. With a few tweaks to the script size and position, you can achieve quite pleasing results.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=304

\relative c'' {
  \override TrillSpanner.bound-details.left.text = \markup{ 
    \musicglyph "scripts.trill" \raise #0.65 \teeny  \sharp }
  
  b1\startTrillSpan
  b1\stopTrillSpan
  
  \override TrillSpanner.bound-details.left.text = \markup{ 
    \musicglyph "scripts.trill" \raise #0.65 \teeny  \flat }
  
  c1\startTrillSpan
  c1\stopTrillSpan
}