lilypond-user
[Top][All Lists]
Advanced

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

Re: Start, end, gradient of Glissando


From: Thomas Morley
Subject: Re: Start, end, gradient of Glissando
Date: Sat, 30 Oct 2021 15:54:21 +0200

Am So., 24. Okt. 2021 um 18:19 Uhr schrieb Aaron Hill
<lilypond@hillvisions.com>:
>
> On 2021-10-24 8:05 am, Thomas Morley wrote:
> > Am So., 24. Okt. 2021 um 16:35 Uhr schrieb Aaron Hill
> >> Let me take a stab at converting the print routine to Scheme.
> >
> > Would be great !!
>
> Sorry for the delay... took me some time to figure out why there was an
> error with cross-staff right-side Y coordinate after porting the logic
> from C++.  I think it's all working as expected, and I have added a few
> new test cases.  (NOTE: I only have 2.22.0 here, so I had to fixup the
> version statement.)  The one thing I did not include was adjusting the
> line ends for the arrows, but I assume the crosses would be best put at
> the arrow points anyway.
>
> There is something to note in the original logic.  If the padding is
> large enough that the line spanner would disappear, then the stencil
> returned is null.  I am also likewise returning the empty list instead
> of a point-pair, so the code that consumes the results would need to
> check for this case.
>
>
> -- Aaron Hill

Hi Aaron,

I now found the time to take a closer look.

There is a problem with cross-staff Glissando and non-zero paddings,
cause by taking relative coords in X/Y direction into account too
late.
Afaict, this needs to come first - changed.

Furthermore, to avoid the "Pythagorean theorem" I changed
         (span-length (sqrt (+ (* span-dx span-dx) (* span-dy span-dy)))))
to
             (span-length (ly:length span-dx span-dy)))


Some other questions, (I attach the file with my comments and TODOs,
etc as well):

(1) You do
           (common-x (ly:grob-common-refpoint grob
                      (ly:grob-common-refpoint
                       (ly:spanner-bound grob LEFT)
                       (ly:spanner-bound grob RIGHT) X) X))
Though, the inner ly:grob-common-refpoint returns already the System
grob, why searching again?
Furthermore, a bit later there's
                    (system (ly:grob-system grob))
which again will return the System grob.
Is there any case where those three are not equal?

(2) There is
                    (dy (if simple-y?
                            0
                            (ly:grob-relative-coordinate grob common-y Y)))
Though if `grob' and `common-y' are equal it returns always zero, afaict.
Is there any example where they are not equal?

(3) Why take 'simple-Y into account?
Well, it's true per default for Glissando, alas it makes no difference afaict.
Btw, we don't have any regtest for it



Many thanks again,
  Harm

Attachment: start-end-gradient-03b-harm.ly
Description: Text Data


reply via email to

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