lilypond-devel
[Top][All Lists]
Advanced

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

[PATCH] Add a way to override the part-combination decision


From: Reinhold Kainhofer
Subject: [PATCH] Add a way to override the part-combination decision
Date: Thu, 16 Sep 2010 19:24:08 +0200
User-agent: KMail/1.13.5 (Linux/2.6.32-24-generic; KDE/4.5.1; i686; ; )

I have now implemented overriding the part-combine decisions. For this, I 
abuse \set partcombineForced =... events to extract the desired combination 
strategy in the \partcombine function (scheme code in scm/part-combine.scm), 
before the property_iterator actually gets a chance to set those properties.

Patch is up at Rietveld:
http://codereview.appspot.com/1698054/

Okay to push to master?

The only downside to this approach (abusing the partcombineForced "context 
property") is that one cannot set a default override, since the context 
property itself is never read. Instead, the code intercepts all \set / \unset 
events to change the property...
So, code like
\context {\Staff
  \set partcombineForced = #'apart
}
will not have ANY effect. 


Commit msg:

Part-combine: Add a way to override the part-combination decision

Add functions partcombineApart[Once], partcombineChords[Once],
partcombineUnisono[Once] and  partcombineAutomatic to tweak the decision of 
the
part-combiner.
Internally, they are implemented as
       \once\set partcombineForced = #...
       \set partcombineForced = #...
       \unset partcombineForced
    
The partcombineForced "context property" is not handled as a context property,
but the \set events are rather handled directly in the part-combiner
(scm/part-combine.scm, function analyse-forced-combine).
As a result, you can't initialize a context to a given default value of
partcombineForced, since the part-combiner never reads the context property
itself, but tries to catch the corresponding \set/\unset events.
For the *Once functions, we rely on the property_iterator to add a 
corresponding
UnsetProperty event at the beginning of the next time step, though.


Cheers,
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]