Many thanks Valentin. At 15:48 on 19 Nov 2024, Valentin Petzel wrote: > Am Dienstag, 19. November 2024, 15:22:16 MEZ schrieb Mark Knoop: >> This works, but crashes with broken hairpins:
> Hello Mark, > the issue here is not the break, but the spanner ending on > a multimeasure rest, which causes in the hairpin not > having a right bound. The reason for this is that the > engraver for dynamics only listenes to note columns, which > includes notes and rests. It does not include MM rests. > This then causes the code to fail, as (ly:spanner-bound > grob RIGHT) will return '(). To fix this use > \override Hairpin.to-barline = > #(lambda (grob) > (let* ((right-bound (ly:spanner-bound grob RIGHT)) > (nhds (and (ly:grob? right-bound) (ly:grob-object right-bound > 'note-heads #f)))) > (not nhds))) > This way if there is no right bound the behaviour will be > just like as if there was a rest. > You will by the way get the same problem when you end the > Hairpin on a skip. > Cheers, > Valentin -- Mark Knoop