lilypond-devel
[Top][All Lists]
Advanced

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

Re: Overrides and nesting: intentional?


From: David Kastrup
Subject: Re: Overrides and nesting: intentional?
Date: Sat, 06 Aug 2011 11:44:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Jan Warchoł <address@hidden> writes:

> 2011/8/5 David Kastrup <address@hidden>:
>
> I'm not sure if i understand it (is "a" a property or a value?),

Property.  I am not yet concerned about values...  Anyway, I am not sure
I understand what I write either.

> but it seems to me that \override should indeed not begin with a
> revert.

My current comprehension is that this is likely the intent of the code.
Doesn't work yet, but I'll try figuring out why, and then likely what
change caused this for what reason.

> However, we may need additional command like
> \revertTillDefaultIsReached or sth like that.
>
> Going back to your colorful examples, here's what effects i'd expect:
>
> \relative c' {
>     c4
>     \once\override Stem #'color = #red
>     \override Stem #'color = #blue
>     c4 c
>     \revert Stem #'color
>     c4
> }
>
> black blue blue black

That's a reasonable expectation, but it requires that \once\override
keeps track of just what it is supposed to revert at the end of the time
step.  Popping the top of the stack would not work, leaving us with
black, blue, red, black.  One possibility would be to store the
\once\override info in a separate location (or with a special mark)
where it does not mix with the \override info.

> \relative c' {
>     c4
>     \override Stem #'color = #blue
>     \once\override Stem #'color = #red
>     c4 c
>     \revert Stem #'color
>     c4
> }
>
> black red blue black

Yup.

> \relative c' {
>     c4
>     \override Stem #'color = #blue
>     \once\override Stem #'color = #red
>     \revert Stem #'color
>     c4 c
>     c4
> }
>
> black black black black.

Actually, I think I'd prefer black, red, black, black.  I feel a revert
should not cancel more than one \override, so something should happen at
the second time step.  The pure stack approach would leave us with
black, blue, black, black, arguably weird.  But pretty easy to explain.

If we aim for black, red, black, black, this would more or less imply
(if things should obey simple rules) that you can _never_ use \revert to
cancel \once\override.  However, the syntax already permits
\once\revert, so maintaining what amounts to a separate stack for \once
could work reasonably well and be nice enough to document.

-- 
David Kastrup



reply via email to

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