lilypond-user
[Top][All Lists]
Advanced

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

Re: Defining new contexts


From: Paul Morris
Subject: Re: Defining new contexts
Date: Tue, 24 Feb 2015 10:14:22 -0700 (MST)

Jim Long wrote
> 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?  

Yes, in fact you're already doing this, explained below...


Jim Long wrote
> In other words, a way to eliminate the
> need for the second \context {} block in your example?

The short answer is no.  Whether (for example) a PianoStaff context can
contain ("accepts") a ChordNames context or not is not a property of
ChordNames but a property of PianoStaff.  So you have to tell PianoStaff
(and friends) to accept your new and unknown context.

You can just do it once and put it in an include file so you don't have to
do it again.  That's what I do.

(I suppose it would be possible to change how LilyPond handles this so that
unknown/custom contexts were accepted by default by other contexts (rather
than rejected by default).  Or, probably better, introduce some kind of
"passes as" property where you could tell other contexts to "treat this
context like X context for purposes of accepting/rejecting it".)

Hope that helps,
-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Defining-new-contexts-tp172185p172251.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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