Re: Crescendo hairpin colliding with repeat bar line
Ruzsa Krisztián <[email protected]>
| Newsgroups | gmane.comp.gnu.lilypond.general |
|---|---|
| Message-ID | <DU0P195MB2871A17A086591B7268D90F8D81F2@DU0P195MB2871.EURP195.PROD.OUTLOOK.COM> |
Thank you for the solution, it works perfectly.
You're right, there is a slight difference and it might look better if
the right endpoint of the hairpin is somewhat closer to the "|" barline,
especially in very tight notation.
Just for an update I'm illustrating my own result adding a hairpin
ending at the ":|." barline.
At first glance it looks like there is a larger gap before the ":|."
barline than before the ".|:" barline, I guess it's because of the
"dots". However it's certainly much better and "cleaner" than the
version without the \layout block:
This is the "fixed" code (first picture):
\version"2.24.4"
PianoRight = \relativec' {
c2\p\<c
c2\mf\<c
\repeatvolta2{c2\f\<c }
c2\ffc
}
PianoLeft = \relativec {
\clef"bass"
c1
c1
\repeatvolta2{c1}
c1
}
\score{
\newPianoStaff
<<
\newStaff= "right"{\PianoRight }
\newStaff= "left"{\PianoLeft }
>>
\layout{
\overrideHairpin.endpoint-alignments =
#(lambda (hairpin)
(let((right-bound (ly:spanner-bound hairpin RIGHT)))
(if(and(grob::has-interface right-bound 'bar-line-interface)
(not(equal?(ly:grob-property right-bound 'glyph"|")
"|")))
(consLEFT LEFT)
(consLEFT RIGHT))))
}
}
Thank you for your support.
Krisztián
- no title specified
2026. 06. 03. 21:24 keltezéssel, Lukas-Fabian Moser írta:
> Hi,
>> Nice! I think we should provide a proper callback function within
>> LilyPond to fix this.
> Do you mean an override like mine should become the default? Maybe,
> yes. I have some other work high on my priority list (there's a
> certain larger pending merge request...), but I could at least to a
> regression test run and see what such a change would effect globally.
>> What exactly is your reason to handle `|`
>> differently?
>
> The reason is that I liked the reduced distance between hairpin and
> barline in the '|' case:
>
> I thought this looked better than the version with global (LEFT .
> LEFT) setting:
>
> But the difference is admittedly tiny, and maybe I was wrong in the
> first place.
>
> It probably played a role that the situation "hairpin stopping at |
> barline" is very common and well-tested in LilyPond, so I deemed it
> improbable that a carefree change of it made by me should be an
> improvement in that case.
>
> Lukas
>