On Mon, Mar 13, 2017 at 10:19 AM, David Nalesnik
<david.nales...@gmail.com> wrote:
> Hi again,
>
> On Mon, Mar 13, 2017 at 10:15 AM, David Kastrup <d...@gnu.org> wrote:
>> David Nalesnik <david.nales...@gmail.com> 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)))

%%%%

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.

DN

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to