lilypond-devel
[Top][All Lists]
Advanced

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

Re: How to customize iterator behavior?


From: Reinhold Kainhofer
Subject: Re: How to customize iterator behavior?
Date: Wed, 15 Sep 2010 19:56:52 +0200
User-agent: KMail/1.13.5 (Linux/2.6.32-24-generic; KDE/4.5.1; i686; ; )

Am Dienstag, 14. September 2010, 04:43:56 schrieben Sie:
> The case for the part-combiner is actually feasible to solve: since
> the part-combine-iterator first processes music to extract ordered
> events (generating a so-called split list), you can disguise your
> instructions as music events (which would be correctly timed into the
> split-list).  You could then make the part-combine-iterator interpret
> these events.

Yes, that was my last resort, which I don't particularly like. Mainly, because 
those events would be handled completely different from all other events 
(which are handled by engravers, while these events would be handled by a 
scheme function that is called long before iterators and engravers do their 
jobs).

Besides, I'm struggling with the parser, which is very strict in what it 
allows. 

In particular, the syntax for customizing partcombine should
1) not have any side effect or visual appearance when not used within 
\partcombine,
2) can be used either as \partCombineAuto for all future notes or as 
\once\partCombineAuto only for the next following note, and
3) should not be attached to a note (i.e. not post-fix notation)

In particular, code like:

mI = \relative c' {
    e4 e \once\partcombineApart c2 |
    e2 e |
    \partcombineApart r2 c |
    \partcombineAutomatic c2 e |
}
mII = \relative c' {
    c2 c2 |
    c2 c |
    c c |
    a c
}
\score { 
    \mI
}
\score {
    \new Staff \partcombine \mI \mII
}

should work and (1) not combine only the two c2 in the first measure, and (2)  
not use solo in the third measure (i.e. starting from the beginning of the 
third measure keep everything apart).

Basically, the only thing that the parser allows at that point in the music 
would be simple_music_property_def, so I'm then back to using \set, but 
process this event already in the determine-split-list function.

Extending part-combine.scm to include this is not too difficult, though, but 
as I said, those \set commands are treated completely different from all other 
\set commands...

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]