lilypond-user
[Top][All Lists]
Advanced

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

Possible source of beam properties confusion


From: Andrew Bernard
Subject: Possible source of beam properties confusion
Date: Sat, 16 Jul 2016 01:47:58 +1000

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.

Have I fundamentally misunderstood the essence of lilypond? Is the
engraving laid out backwards? Is there something intrinsically
non-linear about the engraving engine that means that the way I debug
and develop is in principle disallowed? I ask in all seriousness.
Otherwise, how to explain the results of the MWE?

[The function is purposely cut down so as to be a MWE, and
consequently is only a toy that does nothing but print the property of
interest to me, by way of explanation.]

Andrew

== snip

\version "2.19.45"

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)))

          (display beam-Y-pos) (newline)
          stil))
   #})

{
  \voiceOne

  \once \override Beam.positions = #'(6 . 9)
  \slashDbg 50 0.8 0.7
  b''8 [ b' b' c' c'] s8

  \slashDbg 50 0.8 0.7
  d''8[ b' b' c' c'''] s8

  \once \override Beam.positions = #'(8 . 5)
  \slashDbg 50 0.8 0.7
  d''8[ b' b' c' c''] s8
}

== snip



reply via email to

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