[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Redefining stencils in 'tweaks causes grobs to be printed twice
From: |
Neil Puttock |
Subject: |
Re: Redefining stencils in 'tweaks causes grobs to be printed twice |
Date: |
Thu, 25 Nov 2010 00:06:46 +0000 |
On 24 November 2010 15:44, Valentin Villenave <address@hidden> wrote:
> % Changing the stencil expression through the
> % 'tweaks alist causes a grob to be printed twice.
It's not really the Tweak_engraver's fault (it's about as rudimentary
it's possible for an engraver to be): it simply acknowledges grobs.
This short scheme engraver will let you know which grobs are being acknowledged:
\layout {
\context {
\Voice
\consists #`((acknowledgers
(grob-interface
. ,(lambda (trans grob source)
(let ((cause (event-cause grob)))
(and (ly:stream-event? cause)
(pair? (ly:event-property cause 'tweaks))
(newline)
(display grob)))))))
}
}
#<Grob DynamicText >
#<Grob DynamicLineSpanner >
When a DynamicLineSpanner is created, it gets its event-cause from the
dynamic grob which triggered its creation:
98 Dynamic_align_engraver::acknowledge_dynamic (Grob_info info)
99 {
100 Stream_event *cause = info.event_cause ();
101 create_line_spanner (cause);
I think the only thing we can do here to prevent the 'tweaks setting
from ending up in the DynamicLineSpanner is to change the event-cause
to the grob instead.
Cheers,
Neil