lilypond-user
[Top][All Lists]
Advanced

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

Re: Cross staff stem spacing with proportional notation


From: David Nalesnik
Subject: Re: Cross staff stem spacing with proportional notation
Date: Mon, 13 Mar 2017 10:47:02 -0500

On Mon, Mar 13, 2017 at 10:41 AM, David Nalesnik
<address@hidden> wrote:
> On Mon, Mar 13, 2017 at 10:19 AM, David Nalesnik
> <address@hidden> wrote:
>> Hi again,
>>
>> On Mon, Mar 13, 2017 at 10:15 AM, David Kastrup <address@hidden> wrote:
>>> David Nalesnik <address@hidden> writes:
>>>
>>>> Oh, there's some extra code.  I decided to use a flag to avoid
>>>> redundant calculations, but didn't follow through.
>
> Speaking of redundant calculations...
>
> %% Grob should be a NoteColumn object
> #(define (space-by-stems grob)
>    (let* ((stem (ly:grob-object grob 'stem))
>           (beam (ly:grob-object stem 'beam)))
>      (if (eq? #t (ly:grob-property beam 'cross-staff))
>          (let* ((stems (ly:grob-array->list (ly:grob-object beam 'stems)))
>                  (note-columns (map (lambda (s) (ly:grob-parent s X)) stems))
>                  ;; which NoteColumn am I?
>                  (me-nc (memq grob note-columns))
>                  (orig-stem-pos (ly:grob-relative-coordinate stem (car
> me-nc) X)))
>            (- orig-stem-pos))
>          0.0)))
>
> %%%%

*Arghh!*  Forgive me, but...

%% Grob should be a NoteColumn object
#(define (space-by-stems grob)
   (let* ((stem (ly:grob-object grob 'stem))
          (beam (ly:grob-object stem 'beam)))
     (if (and (ly:grob? beam)
              (eq? #t (ly:grob-property beam 'cross-staff)))
         (let* ((stems (ly:grob-array->list (ly:grob-object beam 'stems)))
                (orig-stem-pos (ly:grob-relative-coordinate stem grob X)))
           (- orig-stem-pos))
         0.0)))

>
> Let me know if you run into issues with a large score.  Could indicate
> that I need to do some checking if objects exist -- of which there is
> currently none.
>



reply via email to

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