[gsharp-devel] ties

Robert STRANDH strandh at labri.fr
Fri Mar 26 07:23:03 UTC 2004


Bonjour,

As you may have noticed, I am working on functionality for drawing
pretty ties to be used with your latest stuff.  

Here is the plan (let me know what you think) :

  * write a function draw-tie (or something like that) or perhaps a
    pair of functions draw-tie-up draw-tie-down, which would take a
    staff step and two x positions corresponding to notehead centers.

  * the function will check the distance between the centers of the
    noteheads in terms of multiples of the staff line distance.  If
    that distance is sufficiently small (say less than 4.5 times the
    staff line distance) a SMALL tie is used.  Such a tie is
    characterized by the fact that it is entirely contained between
    two staff lines.  The smallest small tie that I added to the font
    is roughly 2/3 the staff line distance, so if the center of the
    noteheads are closer than 2.2 staff line distances, they will
    overlap with the tie (but 2.2 is pretty tight).  When the distance
    is greater than 4.5 (or perhaps even less), the small tie is no
    longer pretty, so a LARGE tie should be used.

  * the LARGE tie (not yet added) traverses one staff line.  I am
    planning to make two different shapes of large ties, one to be
    used for noteheads ON a staff line, and another for noteheads
    BETWEEN two staff lines (because they do not end in the same y
    position).  The draw-tie function(s) must then use a different
    glyph for the two possible y-positions of the noteheads. There
    will be a bunch of large ties to be used from distances of around
    3 or so, to perhaps 9 or 10.

  * when the distance is even larger than 9 or 10, we must draw two
    glyphs representing the beginning and the end of the ties, and a
    rectangle for the middle.  I have made all the glyphs so that the
    center falls on exact pixel boundaries which means that the center
    can be invisibly extended by an ordinary black rectangle.

I may make a third kind of tie that takes up more vertical space to be
used when all tied notes are OUTSIDE of a staff, but that is low
priority for now.

Currently I am working on the glyphs.  I may or may not have time to
write the draw-tie function any time soon, so if anyone else wants to
work on that, let me know.  It would be cute to get your example to
draw with the new glyphs.  

I still have no idea how to draw slurs and phrase marks that would
make them both pretty and fast to draw.

Bonne journée,
-- 
Robert Strandh

---------------------------------------------------------------------
Greenspun's Tenth Rule of Programming: any sufficiently complicated C
or Fortran program contains an ad hoc informally-specified bug-ridden
slow implementation of half of Common Lisp.
---------------------------------------------------------------------




More information about the gsharp-devel mailing list