Hi, trying to hack Beam stencil, I need to read out the slope of the original Beam. I thought reading out the y-extent, the x-extent and using the quotient would do the job. But I was wrong: this quotient can't be negativ.
Here's my test-code: \version "2.14.2" #(define (test grob) (let* ((beam (ly:beam::print grob)) (dir (ly:beam::calc-direction grob)) (beam-extent-x (ly:stencil-extent beam X)) (beam-length-x (interval-length beam-extent-x)) (beam-extent-y (ly:stencil-extent beam Y)) (beam-length-y (interval-length beam-extent-y)) (beam-thickness (* 0.48 (ly:output-def-lookup (ly:grob-layout grob) 'staff-space))) (orig-slope (/ (- beam-length-y beam-thickness) beam-length-x)) (markup-a (markup #:with-color red #:beam beam-length-x orig-slope beam-thickness)) ) ;; end of defs in let* (ly:stencil-add beam (ly:stencil-translate-axis (grob-interpret-markup grob markup-a) (* dir 4) Y)) )) %--------------------- Test ---------------------------------------------------- \relative c' { \override Beam #'stencil = #test c8[ c] c c' c c, s4 \break c'8 [ c] c c' c [c,] s4 } All the additional beams should be parallel to the originals. How to do? Thanks, Harm -- View this message in context: http://old.nabble.com/How-to-read-out-the-slope-of-a-beam--tp32617534p32617534.html Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com. _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user