Jump to content

Adding accidentals to a trillspanner: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m New category
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
By overriding <code>bound-details</code>, 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.
By overriding <code>bound-details</code>, 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.


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=304
%% http://lsr.di.unimi.it/LSR/Item?id=304


Line 24: Line 24:
[[Category:Version-specific]]
[[Category:Version-specific]]
[[Category:Workaround]]
[[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
}