gnu-music-discuss
[Top][All Lists]
Advanced

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

Re: [Gnu-music-discuss] cue context?


From: David Ondreka
Subject: Re: [Gnu-music-discuss] cue context?
Date: Mon, 18 Sep 2000 12:11:34 +0200 (CEST)

On Mon, 18 Sep 2000, Mats Bengtsson wrote:

Thank you, Mats, for this concise explanation! (no joke!)

This is really understandable even for an unenlightened (concerning
lily's internals) end user of this great piece of software, like me.

>From my experience with this mailing list it happens rather frequently
that such useful answers end up in the depths of the mailing list archive,
where it's after all very hard to find them. Wouldn't it be a good idea to
collect such documentation fragments (that's what they really are, IMO)
into a single location, something like a FAQ, and distribute it with the
lily source, at least as long as the lily documentation remains in an
incomplete state.

Greetings, David

> OK, let's try to explain how it works:
> Look in the file engraver.ly. First the identifier 
> \StaffContext is defined to give the default behaviour:
> StaffContext = \translator {
>         \type "Engraver_group_engraver";
>         \name Staff ;
>         ...
> }
> So far, this identifier is just an identifier, Lilypond still 
> doesn't really know anything about Staff contexts.
> Next, the line
> \translator{\StaffContext }
> tells Lilypond to create a translator (context handler) with its 
> contents taken from the identifier (named container of things) 
> \StaffContext. Now, Lilypond knows what to do with contexts 
> named "Staff".
> 
> If you want to have a modified translator that's almost like
> the default Staff context, you could use the default definitions
> as a starting point since they are stored in the identifier 
> \StaffContext.
> If you do the change in a single file, just do
> \paper{
>   ...
>   \translator {
>     \StaffContext
>     <own modifications>
>   }
> }
> Again, a new translator is created taking its definitions
> (including the connection to the context name "Staff")
> from the identifier \StaffContext. Additionally, it 
> includes your own modifications.
> If you at some other place have 
>   \translator {
>     \StaffContext
>     <other modifications>
>   }
> you get a translator which overwrites the previous one
> (since it has the same \name) and which again uses the
> default definitions in \StaffContext plus your new
> modifications, i.e., your previous modifications are
> lost.
> 
> If you want to make incremental modifications of a 
> translator, you simply change the identifier too:
> StaffContext = \translator {
>     \StaffContext
>     <global modifications>
>   }
> This will redefine the identifier based on its previous definition.
> Note that these changes will not be noticed by Lilypond until
> you say
> \translator{
>   \StaffContext
> }
> 
> I hope this gives a clearer picture of the mechanism and
> that you realize why your example should be changed to (untested)
> 
> %%%%%%%%%%%%%
> 
> \paper {
> \translator {
>           \VoiceContext
>           \name CueVoice;
>           basicNoteHeadProperties \push #'font-size = #-1
>           basicStemProperties \push #'font-size = #-1
>           basicBeamProperties \push #'font-size = #-1
>           basicTextScriptProperties \push #'font-size = #-1
>           basicSlurProperties \push #'font-size = #-1
>           basicLocalKeyProperties \push #'font-size = #-1
>       }
> StaffContext = \translator{
>   \StaffContext
>   \accepts CueVoice;
> }
> \translator{\StaffContext}
> 
> ...
> 
> \score{
>   ...
>   \paper {
>      \translator{
>        \StaffContext
>        \remove "Time_signature_engraver";
>       }
>     ...
>    }
> }
> %%%%%%%%%%%%%
> 
> If you want, you could use some other identifier for your
> modified version of \Staffcontext, e.g., 
> MyStaffContext = \translator{...}
> \translator{\MyStaffContext}
> 
>         /Mats
> 
> 
> _______________________________________________
> Gnu-music-discuss mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gnu-music-discuss
> 

-----------------------------------------------------------------------
David Ondreka <address@hidden>





reply via email to

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