Thomas and Sharon,

On Fri, Mar 11, 2016 at 3:17 AM, Thomas Morley-2 [via Lilypond] <
ml-node+s1069038n188435...@n5.nabble.com> wrote:

> 2016-03-11 10:23 GMT+01:00 Sharon Rosner <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=188435&i=0>>:
> >> This problem arose before.
> >> One needs to set 'thickness before-line-breaking, but then you don't
> >> have access to the control-points, as far as I remember.
> >> I'm not sure there is any way, have to think about it.
> >
> > Can you explain what’s going on?
>
> I can't, at least not yet (if at all). My regular job is calling, have to
> run.
> I'll try to look at it again in the evening.


I've managed to bypass using before-line-breaking AND after-line-breaking
by assigning the function to the 'thickness property and having each grob
internally calculate its own control points rather than relying on it being
calculated elsewhere (also attached):

%%%%%%%%%%%%%%%%

\version "2.19.36"
#(define (variable-slur-thickness min-l max-l min-t max-t) (lambda (grob)
  (let* ((cpt (ly:slur::calc-control-points grob))
         (cp0 (car cpt)) (cp3 (cadddr cpt))
         (x0 (car cp0)) (y0 (cdr cp0))
         (x1 (car cp3)) (y1 (cdr cp3))
         (len (sqrt (+ (expt (- x1 x0)  2) (expt (- y1 y0)  2))))
         (thickness
           (if (<= len max-l)
             (if (< len min-l)
                min-t
                (+ min-t
                  (* (- len min-l)
                    (/ (- max-t min-t) (- max-l min-l)))))
             max-t)))
         thickness)))

\score {
  \relative c' { \repeat unfold 12 { c1( d) c( d e) c( d e f) c( d e f g) }
}

  \layout {
    \override Slur.thickness = #(variable-slur-thickness 3 10 1 12.7)
  }
}

%%%%%%%%%%%%%%%%

This is certainly an extreme case to illustrate the effect, but it seems to
be working as designed. If we are all satisfied with the functionality,
I'll update the snippet. The only thing I'm (slightly) concerned with is
the duplicate control-point calculation in this function and how it might
affect compilation times if this were applied to a large orchestral score,
for example.

Best,
Abraham


variable-slur-thickness.ly (1K) 
<http://lilypond.1069038.n5.nabble.com/attachment/188437/0/variable-slur-thickness.ly>
variable-slur-thickness.pdf (44K) 
<http://lilypond.1069038.n5.nabble.com/attachment/188437/1/variable-slur-thickness.pdf>




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Variable-slur-thickness-tp188374p188437.html
Sent from the User mailing list archive at Nabble.com.
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to