Thomas Morley <thomasmorle...@gmail.com> 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.  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?



-- 
David Kastrup

Reply via email to