Am Di., 19. Nov. 2024 um 13:54 Uhr schrieb David Kastrup <[email protected]>:
>
> Thomas Morley <[email protected]> writes:
>
> > Hi Mark,
> >
> > probably:
> >
> > \override Hairpin.to-barline =
> > #(grob-transformer 'to-barline
> > (lambda (grob orig)
> > (let* ((right-bound (ly:spanner-bound grob RIGHT))
> > (nhds (ly:grob-object right-bound 'note-heads)))
> > (if (ly:grob-array? nhds) #f #t))))
>
> Wouldn't it be sufficient to write
>
> \override Hairpin.to-barline =
> #(lambda (grob)
> (let* ((right-bound (ly:spanner-bound grob RIGHT))
> (nhds (ly:grob-object right-bound 'note-heads)))
> (not (ly:grob-array? nhds))))
>
> here? After all, the original value of to-barline is not being accessed
> at all.
Or even:
\override Hairpin.to-barline =
#(lambda (grob)
(let* ((right-bound (ly:spanner-bound grob RIGHT))
(nhds (ly:grob-object right-bound 'note-heads #f)))
(not nhds)))
> Though possibly this would need
>
> \override Hairpin.to-barline =
> #(ly:make-unpure-pure-container
> (lambda (grob)
> (let* ((right-bound (ly:spanner-bound grob RIGHT))
> (nhds (ly:grob-object right-bound 'note-heads)))
> (not (ly:grob-array? nhds)))))
>
> to deal with hairpins broken across lines?
i haven't noticed any problems with linebreaks with the code above.
Though, my testings were pretty minimalistic ...
Cheers,
Harm
>
>
> --
> David Kastrup