Hello Andrea, The example I gave is the simplest I could think of and, since the middle note falls exactly in between the other two, you don't have to consider the horizontal spacing. In the general case you definitely have to consider it. I have to say that I've been assuming proportional notation all the time since I use it always (8.4.3 in manual). Sorry for not specifying this. Using proportional notation you can safely assume (most of the time) that the spacing between notes will be equal to their duration, so this way you can compute the Y-offset of middle headless notes given the duration of the notes involved. If you are not using or do not want to use proportional notation, then I guess method 2 is not a good option. Unless, as you suggested before, one could implement a function or macro in scheme accessing the graphical X position of notes.
If you come up with other ideas please let us know. best, Victor. On 4/4/07, Andrea Valle <[EMAIL PROTECTED]> wrote:
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 which the 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 [EMAIL PROTECTED] 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 <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > 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 > \once \override Voice.NoteHead #'transparent =##t > 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[ > \once \override Voice.NoteHead #'transparent =##t > f'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 = ##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 > \once \override Voice.NoteHead #'transparent =##t > \once \override Voice.NoteHead #'Y-offset =#-1.75 > f'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 > [EMAIL PROTECTED] > > > -------------------------------------------------- > Andrea Valle > -------------------------------------------------- > CIRMA - DAMS > Università degli Studi di Torino > --> http://www.cirma.unito.it/andrea/ > --> [EMAIL PROTECTED] > -------------------------------------------------- > > > -------------------------------------------------- Andrea Valle -------------------------------------------------- CIRMA - DAMS Università degli Studi di Torino --> http://www.cirma.unito.it/andrea/ --> [EMAIL PROTECTED] --------------------------------------------------
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user