lilypond-devel
[Top][All Lists]
Advanced

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

Re: Naming _another_ lacking puzzle piece


From: Phil Holmes
Subject: Re: Naming _another_ lacking puzzle piece
Date: Sat, 13 Oct 2012 12:33:17 +0100

----- Original Message ----- From: "David Kastrup" <address@hidden>
To: "Trevor Daniels" <address@hidden>
Cc: <address@hidden>
Sent: Saturday, October 13, 2012 11:25 AM
Subject: Re: Naming _another_ lacking puzzle piece


"Trevor Daniels" <address@hidden> writes:

David Kastrup wrote Saturday, October 13, 2012 1:01 AM

In ly/music-functions-init.ly I see code like the following:

crossStaff =
#(define-music-function (parser location notes) (ly:music?)
 (_i "Create cross-staff stems")
 #{
 \override Stem #'cross-staff = #cross-staff-connect
 \override Flag #'style = #'no-flag
 $notes
 \revert Stem #'cross-staff
 \revert Flag #'style
#})

There is a problem with that: in terms of stack operations, \override
and \revert are not opposing pairs: \override is pop+push (so that
multiple overrides in a row don't accrue cruft), \revert is pop.  So the
net effect of this sequence is "pop", while it should be neutral.

What would be the effect of this?  The implication is that something
goes wrong, but bugs in this area have never been reported, AFAIK.

I understand stacks, pop and push, but I'm clearly missing something
here.  Perhaps it's due to my unfamiliarity with the structure of the
stack(s).

Each context has its own stack, so popping too much only makes a
difference if the stack actually was non-empty to start with.

Check out

\new Staff \with { autoBeaming = ##f }
{ \override Flag #'style = #'mensural c8 c \crossStaff c c c c c c }

After the crossStaff, the flag style has reverted to normal again rather
than mensural.

--
David Kastrup


Surely this points to the pop operation in \override as being at fault? If \override was simply push, rather than pop-push then the code above would seem to work as intended.

The further implication of \override being pop-push would seem to be that if you do something like (pseudo code):

{\override Flag style = mensural c8 c c c \override Flag color = red c c c c}

Then you'd revert the mensural style when you change the color? That would be wholly unexpected to me.

--
Phil Holmes



reply via email to

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