lilypond-user
[Top][All Lists]

## Re: "non adjacent" glissando: state of the art?

 From: v!ctor address@hidden Subject: Re: "non adjacent" glissando: state of the art? Date: Fri, 30 Mar 2007 17:56:42 -0400

Hello Trevor, Andrea, all,

Back when I suggested the inclusion of this feature in Lilypond Han-Wen gave me a brief explanation of why this was complicated to implement. Didn't fully understand, but in general this seems to require a major rewrite of the way glissandi (and probably line spanners in general) operate, which is not trivial and would be expensive.

Since then I've found that this feature is not really necessary if you are willing to do some Lilypond bending. First of all, what's wrong with Lilypond's glissandi? Why add this as a new feature?

Lilypond's requires you to beak a long glissando into short ones, which is not a problem per se. The problem is that, since notes fall on a quantized grid of lines and spaces, the long glissando line looks crooked or jagged. No mortal sin, but it's *very* annoying.  See attached figure bad_gliss.png

There are 2 ways of doing straight lined glissandi.

Method 1 involves using two voices. It looks great on page, but if you do it this way you will find unpleasant Lilypond behavior, in addition to constant warnings (no harm) of clashing note columns. One of the main problems is that using this method you are bound to have long glissandi that extend beyond the system and Lilypond (at least till version 2.9.x) didn't know how to handle these automatically). So you are forced to break the glissando at least at system breaks anyway.

The second method I've found to be much more elegant. It uses less code and stick to the current Lilypond assumption of always connecting contiguous notes. In addition, the stem always ends exactly at the glissando line. Its only drawback is that you need to do some calculation of where exactly in the Y axis the inner headless notes should fall. To do this you simply interpolate between the extreme notes of the glissando and find the correct Y values for the inner notes, then change NoteHead #'Y-offset for these inner notes. Remember that this Y-offset is relative to the center line of the staff, so you need to add or subtract the distance between the innermost note and the staff's center line from your calculation.  Of course you also have to hide the heads.

See attachment good_gliss.png for example of both methods.

Here's the code for the two methods:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.11.20"

\layout{
ragged-last = ##t
\context{\Score
\override Glissando #'bound-details #'right #'padding = #0.0
\override Glissando #'bound-details #'left #'padding = #0.0
}
}

% -----------------------------------------------------------------------------
% normal Lilypond glissando
\new Staff="staff0"{
\new Voice="one"{
c'8[\glissando
f'8\glissando a'8]
}
}

% -----------------------------------------------------------------------------
% method 1: use two voices. one for note heads and durations, the other for glissando line.
% with this method you will get -- waring: ignoring too many clashing note columns.
\new Staff="staff1"{
<<
\new Voice="one"{
c'8[
f'8 a'8]
}
\new Voice="two"{
%\override Voice.Beam #'transparent =##t
\override Voice.Stem #'transparent =##t
\override Voice.Dots #'transparent =##t

%\override LedgerLineSpanner #'transparent = ##t
c'8*2[\glissando a'8]
}
>>
}

% -----------------------------------------------------------------------------
% method 2: use only one voice. simply hide the head of the inner note(s) and shift Y position to the exact place.
% a) Distance form c' to a' in staff lines is a'-c' = 2.5.
% b) Since f' is exactly between c' and a', f' = 2.5/2 = 1.25 above c'.
% c) Since a' is 0.5 lines away from the staff's center line, f' should be Y-offset by 1.25+0.5 down. i.e. -1.75
% This gives exact placement of f'.

\new Staff="staff2"{
\new Voice="one"{
c'8[\glissando
f'8\glissando a'8]
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

best

Victor.

On 3/29/07, Trevor Bača <address@hidden> wrote:
On 3/29/07, Andrea Valle <address@hidden> wrote:
>
> Thanks Mats.
>
> here's the mail starting the thread I'm referring to, and pointing to a
> previous and related one:
>
> http://lists.gnu.org/archive/html/lilypond-user/2006-08/msg00271.html
>
> Best
>
> -a-
>
>
>
> On 29 Mar 2007, at 09:16, Mats Bengtsson wrote:
>
> It would be much easier to realize exactly what you want to achieve if you
> included an example of the LilyPond code you use today (or at least provide
> an exact reference to some of the earlier emails you mention).
>
>   /Mats
>
> Andrea Valle wrote:
>
> Hi to all,
> I'm experimenting what seems to be a common problem. I have to use
> glissandos connecting non adjacent notes, e.g. g4~g16 a8. . The common
> notation, and also the one suggested by Stone (p. 21), is to indicate the
> rhythm without noteheads. So, I'd like to have a straight line connect the g
> and the a and a headless note on the g16.
> I've searched thru the list, and see some (recent) posts related exactly to
> this topic.
> There was also a proposal for sponsoring.
>
> As I have been out of the list for a year,  I'm not understanding the actual
> situation.
> 1. Is there a way to notate a glissando precisely in this way (avoiding the
> trick of using many glissandos connecting the composing notes)?
>
> 2. Is there (still) a sponsoring project for such a feature? In the case, I
> could participate. I saw something about 100 eu, if I understood clearly.
> 2b. What about sponsoring? Is it still active? It isn't clear to me from the
> usual page:

Hi Andrea,

Noncontiguous (or nonadjacent) glissandi haven't been implemented yet.

If the opportunity is still open, I'll be happy to help sponsor.

Trevor.

--
Trevor Bača

_______________________________________________
lilypond-user mailing list