4

Here is the desired engraving (look at the last 4 notes of the left hand):

enter image description here

Here is what I tried:

sib4 la8 sol16 \< (la \! \clef bass
\once \override Hairpin.outside-staff-priority = #0
sib \> la fa \! sol)

outside-staff-priority had no effect.

enter image description here

What should I do?

1 Answer 1

4

Slurs are not placed as outside staff elements, but directly drawn into the score. But this means that outside staff elements like Hairpins will be placed ouside of the slur (which is part of the staff). The solution is rather simple: Tell Lilypond that your Hairpin (or rather its parent, the DynamicLineSpanner) is not an outside staff object. This is done by setting outside-staff-priority to ##f.

\language "italiano"

{
  sib4 la8 sol16 \< _(la \! \clef bass
  \once\override DynamicLineSpanner.outside-staff-priority = ##f
  sib \> la fa \! sol)
}

Alternatively you could make the Slur an outside staff element

\language "italiano"

{
  sib4 la8 sol16 \< 
  \tweak outside-staff-priority #10
  _(la \! \clef bass
  \once\override DynamicLineSpanner.outside-staff-priority = #0
  sib \> la fa \! sol)
}

But this is usually not a good idea, as this will render the Slur shape optimization meaningless (after all the Slur is optimized for a very specific position).

3
  • For your alternative solution, I think you need to move the \once\override Slur.outside-staff-priority = #10, to before the sol16 \< _(. Oct 24, 2023 at 8:44
  • @ElementsinSpace Yes. Replaced it with a tweak. The former does still work because it creates an unattached slur even, which is then applied to the previous note.
    – Lazy
    Oct 24, 2023 at 8:50
  • Thank you! Gosh, a solution, more often than not, is quite simple. I hope I will learn how to solve LilyPond puzzles.
    – facetus
    Oct 24, 2023 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.