lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Constant Hairpin on line break


From: Thomas Morley
Subject: Re: Constant Hairpin on line break
Date: Wed, 21 Mar 2018 11:16:13 +0100

2018-03-21 3:28 GMT+01:00 Karim Haddad <address@hidden>:
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]