lilypond-devel
[Top][All Lists]
Advanced

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

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


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

Am Freitag, 17. September 2010, 14:52:50 schrieb Han-Wen Nienhuys:
> On Fri, Sep 17, 2010 at 7:48 AM, Reinhold Kainhofer
> 
> <address@hidden> wrote:
> > So, you think we should rather extend the parser to cater for that
> > feature? (Or do you know any way to insert an event in simple_music
> > without extending the parser?)
> 
> I was thinking of inserting a zero duration music event, similar to
> eg. barcheck, through an identifier.

Okay, I have now changed the code to use a new PartCombineForceEvent (had to 
add a dummy translator listener to the part-combine engraver to silence 
lilypond)

New patch is up at:
http://codereview.appspot.com/1698054/


My only problem now is that when I add definitions like (so that one can also 
force other types than the pre-defined ones):

partcombineForce =
#(define-music-function (location parser type once) (symbol? boolean?)
....)
partcombineApart = \partcombineForce #'apart ##f
partcombineApartOnce = \partcombineForce #'apart ##t

then processing a file containing some part-combine overrides, I often get a 
warning (not all the time, seems to depend on the music structure...):

warning: Two simultaneous part-combine events, junking this one
warning: Previous part-combine event here


Strangely, it does not happen when I define partcombineApart etc. as

#(define (make-part-combine-force type once)
   (make-music 'EventChord
       'elements (list (make-music 'PartCombineForceEvent
                    'forced-type type 'once once))))
partcombineApart = #(define-music-function (parser location) ()
  (make-part-combine-force 'apart #f))


Any idea what the difference between these two definitions are?


And the other small issue I have: Is there any way to let a music-function 
take a symbol (the forced part-combine strategy) or ##f (to revert to 
automatic part-combination) as argument? That would let me combine the 
partcombineAutomatic and partcombineApart etc. definitions to one single 
definition.

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]