lilypond-user
[Top][All Lists]
Advanced

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

Re: Override a StaffSymbol property outside \new Staff { ... } context


From: Paolo Prete
Subject: Re: Override a StaffSymbol property outside \new Staff { ... } context
Date: Thu, 16 Jan 2020 03:41:15 +0100




On Thu, Jan 16, 2020 at 3:15 AM Aaron Hill <address@hidden> wrote:
On 2020-01-15 5:15 pm, Paolo Prete wrote:
> Hello,
>
> is it possible to override a property of StaffSymbol outside a
>  \new Staff \with { ... }
> context?
>
> I would like to obtain something like:
>
> %%%%%%%%%%%%%%%%%%%
>
> #scheme-code-for-overriding-staffsymbol-for-all-the-staves-in-the-score
> {
>   c' c' c' c'
> }
>
> %%%%%%%%%%%%%%%%%%%

Without needing to mess with Scheme, you can do this using the \layout
block providing you want to change all staves:

%%%%
\version "2.19.83"

\layout {
   \context {
     \Staff
     \override StaffSymbol.color = #red
   }
}

\new Staff { b'4 }
\new Staff { b'4 }
\new Staff { b'4 }
%%%%

(That is a top-level \layout block, but the same can be done within a
\score to scope the effect.) 
     \name RedStaff
     \alias Staff
     \override StaffSymbol.color = #red
   }
   \inherit-acceptability RedStaff Staff
}


Sorry Aaron, I was not precise in my question.
I need to override a property of StaffSymbol, for every staff, outside any music _expression_/block context. Probably I'm not using the right words even now.
But what I need is a sort of a "global" variable which is set for any staff without having to put it into some music _expression_ (like \layout {\context {...}} , or \new Staff \with { ... } etc.).
This is why I asked if is there a Scheme solution

thanks!
Paolo



 

reply via email to

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