lilypond-user
[Top][All Lists]
Advanced

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

Re: Color tweaks (edition engraver)


From: Jim Long
Subject: Re: Color tweaks (edition engraver)
Date: Mon, 27 Apr 2015 13:55:09 -0700
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Apr 27, 2015 at 04:44:52PM +0200, Urs Liska wrote:
> 
> What we have in Frescobaldi depends on what we can "catch" by either 
> listening through engravers or by redefining command. So far I haven't 
> found a notion of a grob knowing if it has been tweaked or not.

As a Scheme/Lilypond novice sitting on the sidelines, I have a
difficult time judging whether my comments are obvious, stupid,
trival, useless, impractical, or some exquisite combination of all
five, but ....  (oh, and there's "poorly thought-out")

If the grob doesn't know whether it's been tweaked, then perhaps
\tweak could do it?  Or, perhaps one could create a wrapper directive
\ctweak which invokes \tweak to perform the specific tweak that was
requested, and then \ctweak could also color the grob that got
tweaked?  Having to change one's code from tweak to ctweak and back
may be less than ideal.  Perhaps a global variable (ugh) could be
used by \ctweak, defaulting to black, so that by default \tweak
and \ctweak are equivalent, except that a user of \ctweak could
alter the global color variable to something other than black, 
resulting in all the \ctweaks appearing in that color.

I can't think offhand how to extend this to support users who use
a color other than black as the base color for engraved grobs, or
for how to show tweaked grobs which already use \ctweak's global
tweak color.  But if \tweak is defined in terms of Scheme/Guile
code (I'm ignorant on that point), perhaps a Scheme guru can
write a first-order approximation of \ctweak that could be 
included in any project's source code where it is desired.

A deeper change might be to add a property to all grobs that
contains a tweak-count, initialized to 0.  \tweak would increment
the count of each grob it touches, and then the grobs would know
whether they've been tweaked or not.  Pretty sure this is the
"obvious" option in paragraph 1.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]