lilypond-user
[Top][All Lists]
Advanced

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

Re: Defining new contexts


From: Jim Long
Subject: Re: Defining new contexts
Date: Mon, 23 Feb 2015 13:32:01 -0800
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Feb 23, 2015 at 10:28:37AM +0100, Thomas Morley wrote:
> 
> Try the following, comments inline:
> 
> \score {
>   <<
>     \new XChords \chordmode { c1 }
>     \new Staff   \chordmode { c1 }
>   >>
>   \layout {
>     \context {
>       %% copies settings from ChordNames
>       %% No need to create a new context from scratch
>       \ChordNames
>       \name XChords
>       \alias ChordNames
>       \override ChordName.font-size = #12
>     }
>     %% let Score accept XChords, likely need to let it be accepted by other
>     %% context as well. I.e. do the same for Pianostaff, GrandStaff, 
> ChoirStaff,
>     %% maybe more, have a look in engraver-init.ly to see which contexts
>     %% accept the default ChordNames
>     \context {
>             \Score
>             \accepts XChords
>     }
>   } % layout
> }
> 
> HTH,
>   Harm

Thank you.  But if I have to do all the \Score \accepts stuff,
then I guess I don't understand what '\alias ChordNames' does in
your example.  I'd like to find a simple way of declaring that
"my custom context X is just like built-in context Y, except that
it modifies these settings."  The appeal of that goes downhill
quickly if there are loose ends that have to be tied back into
Lilypond internals.

Is there a way I can define a context based on ChordNames and
have it automatically inherit all of the properties of a
ChordNames context, except the ones that I specifically change in
my custom definition?  In other words, a way to eliminate the
need for the second \context {} block in your example?

Jim



reply via email to

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