Hi Gilberto,

Well, I've found this :

\version "2.19.15"

beamLength =
#(define-music-function (parser location myLength) (number?)
   (define (myBeamLength grob)
     (let* ((beam (ly:beam::print grob))
           (beam-extent-x (ly:stencil-extent beam X))
           (beam-length-x (interval-length beam-extent-x))
           (beam-thickness (ly:grob-property grob 'beam-thickness))
           (beam-positions (ly:grob-property grob 'positions))
           (mrkp (markup #:beam (* beam-length-x (+ 1 (/ myLength 100)))
                   0 beam-thickness))
           (new-Beam (ly:stencil-translate-axis
                         (ly:stencil-translate-axis
                           (grob-interpret-markup grob mrkp) -0.025 X)
                         (car beam-positions)
                         Y))) new-Beam))
  #{
    \once\override Beam.stencil = #myBeamLength
  #})

\relative c' {
  \beamLength #10
  c8[c c c c c c c]
  \stemDown
  %% limitation: shows only one beam
  \beamLength #6
  c16[c c c c c c c c c c c c c c c]
  \once\override Staff.BarLine.bar-extent = #'(-7 . 2)
}

but, as you can see, it's limited to one beam... :(
Any help from schemers ?
TIA,
Pierre
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to