lilypond-user
[Top][All Lists]
Advanced

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

Re: Possible source of beam properties confusion


From: David Nalesnik
Subject: Re: Possible source of beam properties confusion
Date: Fri, 15 Jul 2016 15:30:35 -0500

> Andrew Bernard <address@hidden> writes:
>
>> I use debug print statements when developing scheme music functions. I
>> have this evening noticed for the first time that my complete
>> perplexity regarding various properties may actually come from the
>> following problem. When I run a function several times in a row, the
>> print output comes out in backwards order to the score note order. [No
>> wonder I have been confused.] The MWE here shows this.

The order might not be strictly backwards, and you'll save yourself
plenty of headaches by
using grob::rhythmic-location to let you know which grob is which:

(I can attest that "out-of-order" display was a big motivation for
writing it :) )


slashDbg =
#(define-music-function (ang stem-fraction protrusion)
   (number? number? number?)
   #{
     \once \override Stem #'stencil =
     #(lambda (grob)
        (let* (
               (beam (ly:grob-object grob 'beam))
               (beam-X-pos (ly:grob-property beam 'X-positions))
               (beam-Y-pos (ly:grob-property beam 'positions))

               (stil (ly:stem::print grob)))
          (format #t "positions of ~a at ~a: ~a~%"
            grob (grob::rhythmic-location grob) beam-Y-pos)
          stil))
   #})


--DN



reply via email to

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