> Andrew Bernard <andrew.bern...@gmail.com> 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

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

Reply via email to