2018-03-21 3:28 GMT+01:00 Karim Haddad <karim.had...@ircam.fr>:
> Hi,
>
> Does somebody know how to avoid having the vertical hook on a line break and 
> just to have it on the end of a constant hairpin ?
> Here is a minimal example code :
>
> \relative c'' {
>  \override Hairpin.stencil = #constante-hairpin
>   c1 \p \< |
>   \break
>   c1 | %%here the hook should not appear if possible.
>   c1 \! |
>   }
>
> Best regards
> --
> Karim Haddad



How about:

\version "2.19.65"

#(define breaking-constante-hairpin
  (lambda (grob)
    (let* ((orig (ly:grob-original grob))
           (siblings (if (ly:grob? orig)
                         (ly:spanner-broken-into orig) '()))
           (grow-dir (ly:grob-property grob 'grow-direction))
                         )
      (if (and (pair? siblings)
               (or (and (eqv? grow-dir RIGHT) (equal? grob (last siblings)))
                   (and (eqv? grow-dir LEFT) (equal? grob (car siblings)))))
          constante-hairpin
          (elbowed-hairpin '((0 . 0) (1.0 . 0.0)) #f)))))


\relative c'' {
 \override Hairpin.stencil = #breaking-constante-hairpin
  c1 \p \< |
  \break
  c1 | %%here the hook should not appear if possible.
  c1 \! |
  }

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to