Thanks, Harm!

On Friday, April 1, 2016, Thomas Morley-2 [via Lilypond] <
ml-node+s1069038n189182...@n5.nabble.com> wrote:

> 2016-03-11 21:51 GMT+01:00 Thomas Morley <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=189182&i=0>>:
>
> > 2016-03-11 14:31 GMT+01:00 Sharon Rosner <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=189182&i=1>>:
> >>> 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):
> >>
> >> Works great! I improved it further by making it compatible with ties
> too:
> >>
> >>
> >> #(define (variable-slur-thickness min-l max-l min-t max-t) (lambda
> (grob)
> >>   (let* ((cpf (if (grob::has-interface grob 'tie-interface)
> >>                   ly:tie::calc-control-points
> >>                   ly:slur::calc-control-points))
> >>          (cpt (cpf grob))
> >>          (cp0 (car cpt)) (cp3 (cadddr cpt))
> >>          (dx (- (car cp3) (car cp0)))
> >>          (dy (- (cdr cp3) (cdr cp0)))
> >>          (len (magnitude (make-rectangular dx dy)))
> >>          (thickness
> >>            (cond ((< len min-l) min-t)
> >>                  ((> len max-l) max-t)
> >>                  (else (+ min-t (* (- len min-l)
> >>                          (/ (- max-t min-t) (- max-l min-l))))))))
> >>
> >>          thickness)))
> >>
> >>
> >>> 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.
> >>
> >> A preliminary check with a 17-page score shows a pretty negligible
> effect on
> >> compilation time, 0.6s (the total time is about 21s), or about 2.7%
> >> additional compilation time. A small price to pay for more beauty!
> >>
> >> Sharon
> >
> >
> >
> > How about below,
> > Should work for all bows, hence the name is changed
> >
> > #(define (variable-bow-thickness min-l max-l min-t max-t)
> >   (lambda (grob)
> >     ;; Get the procedure to calculate the control-points
> >     ;; If none use `fall-back' to return a default-value for 'thickness
> >     (let ((cpf (assoc-get 'control-points (ly:grob-basic-properties
> grob)))
> >           (fall-back 1.2))
> >       (if (procedure? cpf)
> >           (let* ((cpt (cpf grob))
> >                  (cp0 (car cpt))
> >                  (cp3 (cadddr cpt))
> >                  (dx (- (car cp3) (car cp0)))
> >                  (dy (- (cdr cp3) (cdr cp0)))
> >                  (len (magnitude (make-rectangular dx dy)))
> >                  (thickness
> >                    (cond ((< len min-l) min-t)
> >                          ((> len max-l) max-t)
> >                          (else (+ min-t (* (- len min-l)
> >                                (/ (- max-t min-t) (- max-l min-l))))))))
> >             thickness)
> >           fall-back))))
> >
> >
> > Cheers,
> >  Harm
>
> I made some further editions.
> Works now for Slurs, Ties, PhrasingSlurs and theoretical for RepeatTie
> and LaissezVibrerTie.
> Approved as
> Variable bow thickness depending on length
> http://lsr.di.unimi.it/LSR/Item?u=1&id=1028
>
> Cheers,
>   Harm
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=189182&i=2>
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://lilypond.1069038.n5.nabble.com/Variable-slur-thickness-tp188374p189182.html
> To start a new topic under User, email ml-node+s1069038n...@n5.nabble.com
> <javascript:_e(%7B%7D,'cvml','ml-node%2bs1069038n...@n5.nabble.com');>
> To unsubscribe from Lilypond, click here
> <http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=dGlzaW1zdC5saWx5cG9uZEBnbWFpbC5jb218Mnw4MzU3Njg3MDU=>
> .
> NAML
> <http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Variable-slur-thickness-tp188374p189194.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