lilypond-devel
[Top][All Lists]
Advanced

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

Re: cross-staff, broken Glissando


From: Jean Abou Samra
Subject: Re: cross-staff, broken Glissando
Date: Sun, 7 Nov 2021 14:25:54 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1



Le 07/11/2021 à 14:15, Thomas Morley a écrit :
Am So., 7. Nov. 2021 um 14:00 Uhr schrieb Jean Abou Samra <jean@abou-samra.fr>:

That said,...
If I always compensate the right ending-point with (pseudo-code)
(ly:grob-relative-coordinate <Glissando-grob> <System-grob> Y)
Then the crosses are at those positions Mike's patch promises.
Really System? Isn't this going to create a
cyclic dependency between the stencil and
vertical alignment for non-cross-staff glissandi
via VerticalAxisGroup skylines? Off the top I would
think it should be a matter of correcting
reference points (see above).
I compile with recent master, so your added warnings for  cyclic
dependencies may pop up.
They don't.

Ah, because vertical alignment works via
ly:grob-translate-axis! and doesn't mark the
dependencies. Sigh.

Look at:

<<
    \new Staff {
      c'1
    }
    \new Staff {
      \override Glissando.stencil =
        #(lambda (grob)
           (ly:message "~s"
                       (ly:grob-relative-coordinate
                         grob
                         (ly:grob-system grob)
                         Y))
           (ly:line-spanner::print grob))
      c'1\glissando c''1
    }
  >>

It prints "0.0". So there's no cyclic dependency
warned about, but it's not doing what you intend.
How could it? The glissando is part of the vertical
skylines of the VerticalAxisGroup. These are the
basis for vertical alignment. So you need the glissando's
stencil before you can take the Y coordinate of the
glissando relative to the system. Unless you have
a cross-staff glissando, because these aren't part
of the skylines -- but even then there is usually no
reason to take the root system and not just a refpoint
computed generically for both non-cross-staff
and cross-staff grobs.
For non-cross-staff Glissando it returns always zero, yes, for
cross-staff a certain value is found:

<<
    \new Staff = "top" {
      c'1
    }
    \new Staff {
      \override Glissando.stencil =
        #(lambda (grob)
           (ly:message "~s"
                       (ly:grob-relative-coordinate
                         grob
                         (ly:grob-system grob)
                         Y))
           (ly:line-spanner::print grob))
      c'1\glissando \change Staff = "top" c''1
    }
  >>

-> -12.779

I tend to think: nice, let us always add this value, in any case it
only matters for cross-staff at all.

Why not?

Because if you set the vertical-skylines to ##f,
the value will suddenly get nonzero and the stencil
will change unexpectedly. It's not a good thing to
rely on callback order.

Best,
Jean



reply via email to

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