lilypond-user
[Top][All Lists]
Advanced

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

Re: Coloring Ledger Lines


From: David Nalesnik
Subject: Re: Coloring Ledger Lines
Date: Sun, 8 Mar 2015 10:52:37 -0500

Hi,

On Sun, Mar 8, 2015 at 9:35 AM, Pierre Perol-Schneider <address@hidden> wrote:
No clue.
I just know that some grobs, like 'StaffSymbol' too, need to be reverted that way :

Consider this snippet:

\version "2.19.16"

#(define ledgerInfo
   (lambda (grob)
     (let* ((refp (ly:grob-system grob))
            (all (ly:grob-array->list (ly:grob-object refp 'all-elements)))
            (ledgers (filter (lambda (l)
                               (grob::has-interface l 'ledger-line-spanner-interface))
                             all)))
       (display ledgers) (newline))))


\relative c' {
  \override Staff.StaffSymbol.after-line-breaking =
   #(lambda (grob) (display grob) (newline))
  \override Staff.LedgerLineSpanner.after-line-breaking = #ledgerInfo
  \override NoteHead.color = #grey
  \override Stem.color = #grey
  \override Staff.LedgerLineSpanner.color = #grey
  \override Staff.StaffSymbol.color = #grey
  a4 a a a
  %\stopStaff
  %\startStaff
  \revert NoteHead.color
  \revert Stem.color
  \revert Staff.LedgerLineSpanner.color
  \revert Staff.StaffSymbol.color
  %\startStaff
  a a a a 
}
%%%%%%%%

Notice that with the \stopStaff and \startStaff commented out, there is a single StaffSymbol grob in the example.  It makes sense that any override will apply to the whole object.  When \stopStaff and \startStaff are in effect, a second StaffSymbol grob is created, and it can of course take a new override or revert.

Very surprisingly, there is only a single LedgerLineSpanner per StaffSymbol object!  This means that any override of LedgerLineSpanner will affect all of them.

--David

reply via email to

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