lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Harp Pedal Spanner


From: Alexandre Loomis
Subject: Harp Pedal Spanner
Date: Thu, 2 Mar 2023 12:11:32 -0700

Hi,

I'm having trouble defining a harp pedal spanner. I'd like to be able to write code like

\relative c' { f4 _\startPedal "F♮" g fes \endPedal "♭" }

and get as output the notes, with F♮ below the f natural, ♭ below the f flat, and a line connecting the markups. So far the closest I've been able to get is

\relative c' { \startPedal "F♮" \endPedal "♭" f4 _\startTextSpan g fes \stopTextSpan }

where startPedal and endPedal are defined as

startPed =
#(define-music-function
  (text)
  (markup?)
  #{
    \once \override TextSpanner.dash-fraction = #1.0
    \once \override TextSpanner.bound-details.left.text = #text
    \once \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
    \once \override TextSpanner.font-shape = #'upright
  #}
)

endPed =
#(define-music-function
  (text)
  (markup?)
  #{
    \once \override TextSpanner.bound-details.right.text = #text
    \once \override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER
  #}
)

This produces the correct output, but needing to call all four of startPed, endPed, startTextSpan, and stopTextSpan is inconveniently verbose.

Thanks,
Alex

reply via email to

[Prev in Thread] Current Thread [Next in Thread]