[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixes heights and pure heights of stems. (issue 4898044)

From: Mike Solomon
Subject: Re: Fixes heights and pure heights of stems. (issue 4898044)
Date: Mon, 15 Aug 2011 23:51:16 +0200

On Aug 15, 2011, at 11:33 PM, Neil Puttock wrote:

> On 15 August 2011 13:31,  <address@hidden> wrote:
>> Also, just a quick reply to let you know that the calc_stem_end and
>> calc_stem_begin methods are left in the code base for people who want to
>> override the Y-extent of the stem while conserving either the beginning
>> or end of the stem, ie:
>> \override Stem #'Y-extent = #(lambda (grob) (let ((foo
>> (ly:stem::calc-stem-begin-position grob))) (cons foo (+ foo 10))))
> That's every users who wants cross-staff stems for chords.  Unless you
> can come up with a better interface for dealing with cross-staff
> stems, I'd rather you keep 'length for this case.

How about in output-lib.scm something like:

(define (stem::length grob val)
  (let* ((d (ly:grob-property grob 'direction))
    (half-space (* 0.5 (ly:staff-symbol-staff-space grob)))
    (beg (ly:stem::calc-stem-begin-position grob))
    (ext (if (eqv? d DOWN) (cons (- beg val) beg) (cons beg (+ beg val)))))
 (cons (* (car ext) half-space) (* (cdr ext) half-space))))

Then, for the user,
\override Stem #'Y-extent = #(stem::length 20)

(note that the above is not tested...I am too tired to figure out how 
half-space needs to function here (division or multiplication), but I will 

+ a convert-ly rule.

Do you think that would suffice?

It should also be possible to connect cross staff stems with code that's not 
unlike that which connects cross staff arpeggios (I haven't tried it yet, but I 
don't see why it wouldn't work...).

> BTW, I had a head-scratching moment with the above override until I
> realized that the begin/end-position callbacks return half-staff-space
> values.

Sorry - forgot about that!  The functions should, in theory, return the values 
that the originals did.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]