[Top][All Lists]

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

How to break a circular dependency in an iterator?

From: Reinhold Kainhofer
Subject: How to break a circular dependency in an iterator?
Date: Mon, 23 Aug 2010 22:39:23 +0200
User-agent: KMail/1.13.5 (Linux/2.6.32-24-generic; KDE/4.5.0; i686; ; )

I'm still working on making the part-combiner a bit more flexible by using a 
context property to force a given combination strategy instead of the value 
from the automatically-determined split-list (which would suddenly make 
\partcombine really usable for real-life scores!), e.g.

\partcombine { c4 \set Staff.partCombineForced = #'apart d } {e e}

Now, the partcombine iterator decides to which outlet (i.e. voice1, voice2, 
together or DevNull) the objects of the two voices in each timestep are sent.

When working on the second quarter, the iterator tries to access the Staff's 
partCombineForce property to check for a forced combination strategy.
The problem here is that the \set command appears as an object of the second 
1/4 moment, so that the partCombineForced property has not been set yet. 
Apparently the \set will only be processed AFTER the iterator has done its 
work. But for the iterator to work, I need the \set to be processed before...

I'm really stuck here, so does anyone has an idea how to solve that?
Or how can I change my approach to make it work... 

To try it out, you can use my patch from:

Thanks a lot,

PS: If I use a parallel control voice, it works, because there the separate 
control voice is processing the \set before the part combine iterator does its 
  { s4 \set Staff.partCombineForced = #'apart s4 }
  \partcombine { c4 d } {e e}
However, I don't regard this a nasty workaround/hack, rather than a proper 
solution to the general problem. (Plus, it makes very long scores practically 

Reinhold Kainhofer, address@hidden,
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 *, DVR: 0005886
 * LilyPond, Music typesetting,

reply via email to

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