[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue 1228 in lilypond: \override RestCollision #'positioning-done =
Re: Issue 1228 in lilypond: \override RestCollision #'positioning-done = #merge-rests-on-positioning
Wed, 18 Aug 2010 18:32:36 +0000
Comment #1 on issue 1228 by wbsoft: \override RestCollision
#'positioning-done = #merge-rests-on-positioning
This file, merge-rests.ily, implements merging of simultaneous rests and
It works only for two voices (but this is acceptable and documentable).
The normal rest merging is as in LSR #336, I added support for multimeasure
rests using the following algorithm:
- for every MMRest, record the StaffSymbol and the NonMusicalPaperColumn
the MMrest resides in, on the moment 'Y-offset is requested.
- if there is already a MMRest found in this StaffSymbol and
NonMusicalPaperColumn, delete that one and return 0
- if there wasn't a MMRest in this StaffSymbol and NonMusicalPaperColumn,
store this one and return the default value from
I use a weak key hash so the storage will be gc'ed as soon as the staff
symbol is gc'ed. the hash is enclosed in a (let ()) expression outside the
function body so the global namespace is not polluted.
It seems to work well on some files I tested it on. The usage is documented
in the file. Please give feedback as this is my first try at some more
complicated Scheme stuff. :-)
merge-rests.ily 4.2 KB