[gsharp-devel] ties

Christophe Rhodes csr21 at cam.ac.uk
Mon Mar 22 17:21:41 UTC 2004


Attached is a partial implementation of ties.  As seems to be usual,
it comes with a bundle of various FIXMEs and caveats.

The major problem I had here is with the read-only nature of notes.
Why is this?  Is it to ensure that there are always new objects for
the GUI layer?  In any case, it makes the work quite tricky, as each
tie contains two temporally separated notes.  I've implemented ties
here as properties of notes themselves, rather than a more global
approach, for constant-time performance reasons; however, given that
ties contain notes themselves, each destructive operation on a score
(e.g. adding or removing an accidental) will have to update or destroy
all ties with which the original note was associated.  At present, I
have done this with the toggle tie command itself, but it needs to be
factored out so that com-up, com-down, com-sharper et al. can use it.
(Unless someone can think of a better representation).

Caveat the second is that my drawing skills are not very good.  The
output can be seen at
<http://www-jcsu.jesus.cam.ac.uk/~csr21/ties.png> (the opening few
bars of the top part in Janequin's _Les Cris de Paris_, if anyone's
interested :-) and it's ugly.  The ties, I think, need to be thicker
in the middle (particularly when it's clashing with a staff-line, as
in the Gs), thinner at the ends, and anti-aliased; oh, and posssibly a
curve, rather than two straight lines.

I haven't tested loading or saving, but I have implemented a
print-object method and read macro, so maybe it works.  MIDI
performance of ties works, at least for logically consistent ties.  No
sanity checking is currently done -- ties can be made over logically
non-adjacent notes -- so MIDI performance of this pathological case
may or may not be optimal.  Apart from all this, it's perfect.  

Oh yes, one last thing: the semibreve (whole note) rest appears to
hang down from the wrong line by default; the normal position for that
rest is to hang from the second line from the top of the staff.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ties.diff
URL: <https://mailman.common-lisp.net/pipermail/gsharp-devel/attachments/20040322/9ef579ec/attachment.ksh>
-------------- next part --------------

Comments please,


http://www-jcsu.jesus.cam.ac.uk/~csr21/       +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%")    (pprint #36rJesusCollegeCambridge)

More information about the gsharp-devel mailing list