|
From: | v!ctor address@hidden |
Subject: | Re: "non adjacent" glissando: state of the art? |
Date: | Wed, 4 Apr 2007 18:01:11 -0400 |
Thanks Victor,yes, I implemented the method 2, this time not in Python but in SuperCollider.Just a note. If I understood the method, it works pretty well in the case in whichthe notes are equally spaced. Otherwise one should take into account horizontal pace, which is internal to lily. This is the case where you have more than two notes connected via a unique glissando.Two examples, obtained implementing the method 2.The first is good, the second is acceptable.I'm not obtaining the perfect examples: so maybe there's something imprecise in my implementation (even if I prefer the not touching stem). But I think that the argument should be valid in any case.Best-a-On 3 Apr 2007, at 02:58, v!ctor address@hidden wrote:Hello Andrea,
This may be possible, but I'm affraid I'm pretty much a Scheme illiterate myself. I'd suggest you doing it in python (which is a language you seem to know well). This is what i do.
best,
Victor.On 4/1/07, Andrea Valle < address@hidden> wrote:Thanks a lot Victor,I'm working with your method 2. Really nice, to be included in docs.I was thinking. Premise: I know nothing of lily's internals and about scheme.But:As all the trick is to exactly calculate the offset of the noteheads, wouldn't be possible to add such a calculation as a a sort of macro so to implement \startgliss \stopgliss?Best-a-On 31 Mar 2007, at 00:11, Trevor Bača wrote:On 3/30/07, v!ctor address@hidden <address@hidden> wrote:Hello Trevor, Andrea, all,Back when I suggested the inclusion of this feature in Lilypond Han-Wen gaveme a brief explanation of why this was complicated to implement. Didn'tfully understand, but in general this seems to require a major rewrite ofthe way glissandi (and probably line spanners in general) operate, which isnot trivial and would be expensive.Since then I've found that this feature is not really necessary if you arewilling to do some Lilypond bending. First of all, what's wrong withLilypond's glissandi? Why add this as a new feature?Lilypond's requires you to beak a long glissando into short ones, which isnot a problem per se. The problem is that, since notes fall on a quantizedgrid 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.pngThere are 2 ways of doing straight lined glissandi.Method 1 involves using two voices. It looks great on page, but if you do itthis way you will find unpleasant Lilypond behavior, in addition to constantwarnings (no harm) of clashing note columns. One of the main problems isthat using this method you are bound to have long glissandi that extendbeyond the system and Lilypond (at least till version 2.9.x) didn't know howto handle these automatically). So you are forced to break the glissando atleast at system breaks anyway.The second method I've found to be much more elegant. It uses less code andstick to the current Lilypond assumption of always connecting contiguousnotes. In addition, the stem always ends exactly at the glissando line. Itsonly drawback is that you need to do some calculation of where exactly inthe Y axis the inner headless notes shouldfall. To do this you simplyinterpolate between the extreme notes of the glissando and find the correctY values for the inner notes, then change NoteHead #'Y-offset for theseinner notes. Remember that this Y-offset is relative to the center line ofthe staff, so you need to add or subtract the distance between the innermostnote and the staff's center line from your calculation. Of course you alsohave 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\once \override Voice.NoteHead #'transparent =##tf'8\glissando a'8]}}%-----------------------------------------------------------------------------% method 1: use two voices. one for note heads and durations, the other forglissando line.% with this method you will get -- waring: ignoring too many clashing notecolumns.\new Staff="staff1"{<<\new Voice="one"{c'8[\once \override Voice.NoteHead #'transparent =##tf'8 a'8]}\new Voice="two"{%\override Voice.Beam #'transparent =##t\override Voice.Stem #'transparent =##t\override Voice.Dots #'transparent =##t\override Voice.NoteHead #'transparent =##t%\override LedgerLineSpanner #'transparent = ##tc'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 beY-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\once \override Voice.NoteHead #'transparent =##t\once \override Voice.NoteHead #'Y-offset =#-1.75f'8\glissando a'8]}}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Hi Víctor,You can get rid of the clashing note column warnings with ...\override NoteColumn #'ignore-collision = ##t... which exists specifically to allow us to use complex "layered"notations in multiple voices this way.Very neat examples!--Trevor Bača--------------------------------------------------Andrea Valle--------------------------------------------------CIRMA - DAMSUniversità degli Studi di Torino--> address@hidden--------------------------------------------------
--------------------------------------------------Andrea Valle--------------------------------------------------CIRMA - DAMSUniversità degli Studi di Torino--> address@hidden--------------------------------------------------
[Prev in Thread] | Current Thread | [Next in Thread] |