On Aug 29, 2011, at 11:56 PM, David Nalesnik wrote:

> 
> 
> On Mon, Aug 29, 2011 at 4:50 PM, David Nalesnik <[email protected]> 
> wrote:
> 
> \relative c' {
>        \override Hairpin #'color = #red
>        \key ces\major
>        \eraseBrokenHairpin #(list  41 23  15 0  13 0) ;; recast as offsets 
> from line-width
> 
> Oops, sorry -- above comment should use %% instead of ;;
> 
> David

How about:

\version "2.14.0"

#(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 (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))))
{
 \override Hairpin #'after-line-breaking = #my-callback
 a\< \repeat unfold 31 { a } \break \key fis \major \repeat unfold 74 { a } a\p
}

Cheers,
MS

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to