lilypond-devel
[Top][All Lists]
Advanced

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

How to customize iterator behavior?


From: Reinhold Kainhofer
Subject: How to customize iterator behavior?
Date: Mon, 13 Sep 2010 16:50:30 +0200
User-agent: KMail/1.13.5 (Linux/2.6.32-24-generic; KDE/4.5.1; i686; ; )

I have a hard problem, which probably only someone with a lot of knowledge 
about the LilyPond internals can solve:

I need to give the user the possibility to change the behavior of an interator 
by setting some property (or some other way, I don't care about the details). 
An example for this is the Lyric_combine_music_iterator, which checks for the 
context's associatedVoiceContext property.

Now the problem is that when the iterator does it's job in the 
*_iterator::process function, the context properties for that moment have not 
been set yet. So, all calls to e.g. \set Lyrics.associatedVoiceContext = ... 
will take effect one moment too late.
The docs note that this is known and "not a bug", which I would object too. It 
is a bug, we have just refused to fix it so far. A \set should always take 
effect immedately, not one time step later in some cases, while in others it 
takes effect immediately.

I'm running into the same problem with the part-combiner.

Can you think of any way to set a context property before the iterator's 
process method is called?
Or alternatively, is there any object accepted by the parser that can be 
(ab)used to influence how an iterator does its job? Music events obviously do 
not work for this case.

As I see it, we are currently missing a way to configure an interator. For 
contexts and engravers we have context properties, for grobs we have grob 
properties, but for iterators, there is no such thing...

Thanks a lot,
Reinhold
-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



reply via email to

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