Jump to content

Adding accidentals to a trillspanner: Difference between revisions

From LilyPond wiki
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
No edit summary
Line 23: Line 23:
[[Category:Pitches]]
[[Category:Pitches]]
[[Category:Version-specific]]
[[Category:Version-specific]]
[[Category:Workaround]]
[[Category:Workaround]][[Category:Snippet]]

Revision as of 22:46, 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
}