[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: missing glissando features (bugs?)
From: |
Neil Puttock |
Subject: |
Re: missing glissando features (bugs?) |
Date: |
Sun, 10 May 2009 23:29:33 +0100 |
2009/5/10 Marc Hohl <address@hidden>:
> And here's my solution for tablature:
>
> #(define (glissando::calc-tab-extra-dy grob)
> (let* ((original (ly:grob-original grob))
> (left-bound (ly:spanner-bound original LEFT))
> (right-bound (ly:spanner-bound original RIGHT))
> (left-pitch (ly:event-property (event-cause left-bound) 'pitch))
> (right-pitch (ly:event-property (event-cause right-bound) 'pitch))
> (left-staff-position (ly:grob-property left-bound 'staff-position))
> (right-staff-position (ly:grob-property right-bound
> 'staff-position))
> (extra-dy
> (if (and (= left-staff-position right-staff-position)
> (ly:pitch<? right-pitch left-pitch))
Be careful here: ly:pitch<? compares pitches lexicographically, so
you'll come unstuck if the pitches differ only in alteration:
#(let ((c-natural (ly:make-pitch 0 0 0))
(c-sharp (ly:make-pitch 0 0 SHARP)))
(display (ly:pitch<? c-natural c-sharp))
(newline)
(display (ly:pitch<? c-sharp c-natural)))
> -1
> 1 ))) ;; I don't know why, but "0" doesn't work properly in
> tablature, compare glissando::calc-extra-dy
Unless you can return the correct value or 0 (in the same way as
glissando::calc-extra-dy), you'll probably need to use cond and else:
(cond
((right pitch is lower) -1)
(right pitch is higher) 1)
(else 0))
Regards,
Neil
- missing glissando features (bugs?), Marc Hohl, 2009/05/02
- Re: missing glissando features (bugs?), Neil Thornock, 2009/05/02
- Re: missing glissando features (bugs?), Neil Puttock, 2009/05/02
- Re: missing glissando features (bugs?), Marc Hohl, 2009/05/05
- Re: missing glissando features (bugs?), Marc Hohl, 2009/05/09
- Re: missing glissando features (bugs?), Marc Hohl, 2009/05/10
- Re: missing glissando features (bugs?),
Neil Puttock <=
- Re: missing glissando features (bugs?), Marc Hohl, 2009/05/11
- Re: missing glissando features (bugs?), Neil Puttock, 2009/05/13
- Re: missing glissando features (bugs?), Marc Hohl, 2009/05/14
- Re: missing glissando features (bugs?), Neil Puttock, 2009/05/14
- Re: missing glissando features (bugs?), Marc Hohl, 2009/05/15
- Re: missing glissando features (bugs?), Neil Puttock, 2009/05/15
- Re: missing glissando features (bugs?), Marc Hohl, 2009/05/16
- Re: missing glissando features (bugs?), Neil Puttock, 2009/05/18
- Re: missing glissando features (bugs?), Mats Bengtsson, 2009/05/19
- Re: missing glissando features (bugs?), Jonathan Kulp, 2009/05/19