lilypond-user
[Top][All Lists]
Advanced

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

Re: shorten a broken hairpin at a linebreak?


From: harm6
Subject: Re: shorten a broken hairpin at a linebreak?
Date: Wed, 31 Aug 2011 08:30:17 -0700 (PDT)


Mike Solomon-2 wrote:
> 
> Hmm...I thought that after-line-breaking would be called after the bounds
> were set, but I was wrong.
> 
> Try:
> 
> #(define (has-interface? grob interface)
>  (member interface
>          (assoc-get 'interfaces
>                     (ly:grob-property grob 'meta))))
> 
> #(define (find-system grob)
>  (if (has-interface? grob 'system-interface)
>      grob
>      (find-system (ly:grob-parent grob X))))
> 
> #(define (first-musical-column grobl)
>  (if (not (eqv? #t (ly:grob-property (car grobl) 'non-musical)))
>      (car grobl)
>      (first-musical-column (cdr grobl))))
> 
> #(define (change-bound grob)
>  (let* ((system (find-system grob))
>         (cols (ly:grob-array->list (ly:grob-object system 'columns)))
>         (musical-column (first-musical-column (reverse cols))))
>    (ly:spanner-set-bound! grob RIGHT musical-column)))
> 
> #(define (internal-my-callback grob)
>   (let* (
>          ;; have we been split?
>          (orig (ly:grob-original grob))
> 
>          ;; if yes, get the split pieces (our siblings)
>          (siblings (if (ly:grob? orig)
>                        (ly:spanner-broken-into orig)
>                        '())))
> 
>     (if (and (>= (length siblings) 2)
>              (not (eq? (car (reverse siblings)) grob)))
>       (change-bound grob))))
> 
> #(define (my-callback grob)
>  (internal-my-callback grob)
>  (ly:hairpin::print grob))
> 
> {
> a1\break
> \override Hairpin #'stencil = #my-callback
> a\< \repeat unfold 31 { a } \break \key fis \major
> \repeat unfold 32 { a } \break \key ees \major \repeat unfold 42 {a} a\p
> }
> 
> It may result in oddities with other grobs that rely on spanner bounds,
> but it should be tame in most situations.
> 
> Cheers,
> MS
> 


    Hi Mike,

    now it works as expected, but I found another problem:
    Using \> instead of \< looks like succeeding decrescendos and not one
continuous one.

    One more question: Would it be possible to increase the control of the
length of the hairpin?
    Doing the following at the end of a hairpin allows some more control on
the length of the hairpin. Not so for anywhere in the middle of it..

    \relative c' {
      \override Hairpin #'stencil = #my-callback
       c'1\> c1*5/8 s1*3/8
       \break
       \key cis\major
      d2 e e1*7/8 s1*1/8\!
    }

    Would any such increased / improved control be feasible in the context
of the solution you developed so far?


    Best,
    Harm

-- 
View this message in context: 
http://old.nabble.com/shorten-a-broken-hairpin-at-a-linebreak--tp32343028p32373099.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.




reply via email to

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