lilypond-user
[Top][All Lists]
Advanced

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

Re: Flat flared hairpins


From: Andrew Bernard
Subject: Re: Flat flared hairpins
Date: Mon, 31 Dec 2018 19:58:19 +1100

Hi Malte,

I may be able to work with something like below.

Why do you have to use cadr and not cdr on the ly:grob-set-property line? Isn't the broken part the second item in a list of two items? How to understand this?

%====
\version "2.19.82"

% simple debug print
#(define (dbg . args)
   "Simple debug console print."
   (cond
    ((not (null? args))
     (display (car args))
     (display " ")
     (apply dbg (cdr args)))
    (else (newline))
    )
   )

music = {

  \override Hairpin.after-line-breaking =
  #(lambda (grob)
     (let* ((orig (ly:grob-original grob))
            (siblings (if (ly:grob? orig)
                          (ly:spanner-broken-into orig) '())))
       (dbg "here")
       (dbg grob)
       (dbg "length of siblings list:" (length siblings))
       (dbg siblings)
       (if (and (pair? siblings) (equal? grob (cadr siblings)))
           (ly:grob-set-property! grob 'color #'red
             ))))

  c'4 c' c' c'\<
  \break
  c' c'\! c' c'

}

\score {
  \new Staff {
    \music
  }
  \layout {
  }
}
$====



reply via email to

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