lilypond-user
[Top][All Lists]
Advanced

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

Re: Understanding fancy-gliss


From: Thomas Morley
Subject: Re: Understanding fancy-gliss
Date: Wed, 1 Jan 2020 15:44:02 +0100

Am Di., 31. Dez. 2019 um 21:40 Uhr schrieb Daniel Rosen <address@hidden>:
>
> I'm having a little bit of trouble understanding exactly how to use Harm's 
> excellent fancy-gliss function, particularly when it comes to creating 
> curves. Can someone help me get a better handle on this?

Hi Daniel,

the usual glissando starts at a point (x1 y2) and ends at another point (x2 y2).

fancy-gliss expects a list, where every sublist needs to be a
number-list of length 2 or 6, with alternating values for x- and
y-coordinates.
6 entries will result in a bezier-curve. 2 entries in a straight line,
both starting at the last coordinate (retrieved from the last two
values) of the previous given sublist or at the starting point (x1
y1). You may regard the starting-point as (0 0).
These coordinates are not taken as exact coordinates. While the
y-values are taken as entered, NB relative to y1, the x-values are
scaled to let the final result fit the length of original glissando.

In its most simple usage fancy-gliss starts at said starting point
(there is no method impemented to change that). It ends at the usual
x2 (for the X-axis) of the original glissando and at the given
y-coordinate.
The given y-coordinate is relative to the y-value of the starting-point.
The given x-coodinate is scaled to fit the original x2.

Thus both glissandi below look equal:
\layout {
  \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
  \override Glissando.minimum-length = 30
}

{
  \fancy-gliss #'((1 0))
  b4\glissando
  b'
  \fancy-gliss #'((10 0))
  b4\glissando
  b'
}

With complexer input-lists all x-values are taken into account and
scaled accordingly.
Below, the first glissando starts as usual (x1 y1), after 1/11 (of the
original length) the line goes to (+ y1 10), after 11/11 it returns to
(+ y1 0).
The second glissando starts and ends as the first, but after 10/11 (of
the original length) the line goes to (+ y1 10).
Y-values relative to y1.

{
  \fancy-gliss #'((1 10)(11 0))
  b4\glissando
  b'

  \fancy-gliss #'((10 10)(11 0))
  b4\glissando
  b'
}

As said sublists of length 6 will result into bezier curves, the
values are taken as control-points.
Attached you'll find an image where I added some debugging code for

{
  \fancy-gliss #'((2 6 4 6 6 0)(8 10) (10 3.5))
  b4\glissando
  b'

}

The red crosses are the entered coordinates (I've manually added the
starting point), relative to the middle staff-line.
The black crosses are the calculated coordinates.
Furthermore I added lines demonstrating which original point becomes
which translated point.

HTH,
  Harm

Attachment: atest-96.png
Description: PNG image


reply via email to

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