lilypond-user
[Top][All Lists]
Advanced

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

Re: Color one SystemStartBrace


From: David Nalesnik
Subject: Re: Color one SystemStartBrace
Date: Wed, 13 Mar 2019 16:58:51 -0500

On Wed, Mar 13, 2019 at 4:55 PM David Nalesnik <address@hidden> wrote:
>
> On Wed, Mar 13, 2019 at 4:27 PM David Nalesnik <address@hidden> wrote:
> >
> > On Wed, Mar 13, 2019 at 3:44 PM Urs Liska <address@hidden> wrote:
> > >
> > >
> > > Am 13.03.19 um 19:47 schrieb David Nalesnik:
> > > > On Wed, Mar 13, 2019 at 1:44 PM Aaron Hill <address@hidden> wrote:
> > > >> On 2019-03-13 11:41 am, Aaron Hill wrote:
> > > >>> On 2019-03-13 10:53 am, Urs Liska wrote:
> > > >>>> Hi all,
> > > >>>>
> > > >>>> is it possible to get hold of a single SystemStartBrace/Bar/Bracket 
> > > >>>> to
> > > >>>> color it?
> > > >>>>
> > > >>>> \layout {
> > > >>>>    \context {
> > > >>>>      \Score
> > > >>>>      \override SystemStartBrace.color = #red
> > > >>>>    }
> > > >>>> }
> > > >>>>
> > > >>>> works but
> > > >>>>
> > > >>>> (\once) \override Score.SystemStartBrace.color = #red
> > > >>>>
> > > >>>> somewhere in the input doesn't have any effect.
> > > >>>>
> > > >>>> Any suggestions?
> > > >>> I think it's StaffGroup (or other appropriate container) that you
> > > >>> want, not Score:
> > > >>>
> > > >>> %%%%
> > > >>> \version "2.19.82"
> > > >>>
> > > >>> \new StaffGroup <<
> > > >>>    \new Staff { \override StaffGroup.SystemStartBracket.color = #red 
> > > >>> b'1
> > > >>> }
> > > >>>    \new Staff { b'1 }
> > > >>> %%%%
> > > >> Oops, Score works too:
> > > >>
> > > >> %%%%
> > > >> \version "2.19.82"
> > > >>
> > > >> \score { <<
> > > >>     \new Staff { \override Score.SystemStartBar.color = #red b'1 }
> > > >>     \new Staff { b'1 }
> > > >>>> }
> > > >> %%%%
> > > >>
> > > >> -- Aaron Hill
> > > > This will color start bars on successive lines, too.
> > > >
> > > > Try:
> > > >
> > > > \version "2.19.82"
> > > >
> > > > one = \relative c' {
> > > >    \alterBroken color #(list red blue black) 
> > > > StaffGroup.SystemStartBracket
> > > >    a1 \break
> > > >    a \break
> > > >    a
> > > > }
> > > >
> > > > two = \relative c' {
> > > >    c c c
> > > > }
> > > >
> > > > \new StaffGroup <<
> > > >    \new Staff \one
> > > >    \new Staff \two
> > > > HTH,
> > > > David
> > >
> > > Well, I *could* make that work in my case by placing that command at the
> > > beginning of the score and use a list with all elements black and only
> > > the last one in the highlighting color.
> > >
> > > But actually I would prefer having something that I can insert in the
> > > input file right where it happens. Like not saying "color the fifth
> > > system from here (the start)" but rather "color the next system".
> > >
> > > Urs
> >
> > You're not going to be able to do it simply, any more than you can
> > introduce overrides of individual pieces of a broken slur once it's
> > begun.  The starting bars are all clones of the first object.
> >
> > The only way I can suggest is to collect all the grobs on the system
> > in question using the 'all-elements property (you can do this through
> > a grob on the system in question), locate the target grob, and set its
> > 'color property.
> >
> > DN
>
> Like this:
>
> \version "2.19.82"
>
> #(define drop-in-on-spanner
>    (lambda (grob)
>      (let* ((elts (ly:grob-array->list (ly:grob-object (ly:grob-system
> grob) 'all-elements)))
>             (ssb (filter (lambda (e) (grob::has-interface e
> 'system-start-delimiter-interface))
>                          elts)))
>        (set! (ly:grob-property (car ssb) 'color) red))))
>
> \new StaffGroup <<
>   \new Staff {
>     c1 \break
>     \once \override NoteHead.after-line-breaking = #drop-in-on-spanner
>     c1 \break
>     c1 \break
>   }
>   \new Staff {
>     c1
>     c1
>     c1
>   }
> >>

Prettier:
\new StaffGroup <<
  \new Staff {
    c1 \break
    \tweak after-line-breaking #drop-in-on-spanner c1 \break
    c1 \break
  }
  \new Staff {
    c1
    c1
    c1
  }
>>



reply via email to

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