Re: Variable slur thickness

2016-04-01 Thread tisimst
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=189182=0>>:
>
> > 2016-03-11 14:31 GMT+01:00 Sharon Rosner <[hidden email]
> <http:///user/SendEmail.jtp?type=node=189182=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=1028
>
> Cheers,
>   Harm
>
> ___
> lilypond-user mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node=189182=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=2=dGlzaW1zdC5saWx5cG9uZEBnbWFpbC5jb218Mnw4MzU3Njg3MDU=>
> .
> NAML
> <http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=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


Re: Variable slur thickness

2016-04-01 Thread Thomas Morley
2016-03-11 21:51 GMT+01:00 Thomas Morley <thomasmorle...@gmail.com>:
> 2016-03-11 14:31 GMT+01:00 Sharon Rosner <cico...@gmail.com>:
>>> 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=1028

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Inline images, was Re: Variable slur thickness

2016-03-19 Thread David Wright
On Thu 10 Mar 2016 at 10:19:29 (-0600), Cynthia Karl wrote:
> On Thu, 10 Mar 2016 06:04:57 -0700 (MST) tisimst  
> schrieb:
> > 
> > HTH,
> > Abraham
> > 
> > P.S. Some of the power users on this list filter inline images, so if you
> > wouldn't mind making the image an attachment next time, I know they'll
> > appreciate it. :-)
> 
> Why on earth would anyone filter inline images?  They are extremely 
> convenient.  They’re right there in the email, one doesn’t have to change 
> context to a browser and interrupt the flow of reading the message.

There are plenty of explanations on the web about the disadvantages of
inline images. Myself, I don't filter them, but I read emails as text,
which amounts to the same thing.

> On the other hand, for me who gets the lilypond-user messages in the Digest 
> form, attachments suck big time.  For example, below after the " next 
> part “ line is a link to such an attachment (I think).  When I click on 
> that link, the result is:
> 
> > Not Found
> > 
> > The requested URL 
> > /archive/html/lilypond-user/attachments/20160310/4addc8f3/attachment.html 
> > was not found on this server.

Agreed, there is a problem. The links are set wrongly, yet the
attachments exist elsewhere. For example, the attachment given
in the digest as
http://lists.gnu.org/archive/html/lilypond-user/attachments/20160312/6eba7c13/attachment.png
is actually at
http://lists.gnu.org/archive/html/lilypond-user/2016-03/pngHJxj6irVRF.png

> That’s not very convenient at all.  Am I the only one with this problem?  
> What’s the solution?

Dunno. Step one is emailing the webmaster, which I've done.

> Maybe it would be nice if inline images were also added as attachments?

Yes; maybe they will.

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-11 Thread Thomas Morley
2016-03-11 14:31 GMT+01:00 Sharon Rosner <cico...@gmail.com>:
>> 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

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-11 Thread Sharon Rosner
> 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



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


Re: Variable slur thickness

2016-03-11 Thread tisimst
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=188435=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


Re: Variable slur thickness

2016-03-11 Thread Thomas Morley
2016-03-11 10:23 GMT+01:00 Sharon Rosner :
>> 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.

Cheers,
  Harm

> As far as I could tell from debugging the callback gets called for all slurs, 
> but for some reason beginning on the second line the call to 
> ly:grob-set-property! takes effect *only* for slurs that are broken.
>
> Is this behaviour intentional or is it a bug?
>
> Sharon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-11 Thread Sharon Rosner
> 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? As far as I could tell from debugging the 
callback gets called for all slurs, but for some reason beginning on the second 
line the call to ly:grob-set-property! takes effect *only* for slurs that are 
broken.

Is this behaviour intentional or is it a bug?

Sharon
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-11 Thread Thomas Morley
2016-03-11 10:01 GMT+01:00 Sharon Rosner :
>> Thus again: how should it look, in cases where a broken slur has a
>> (very) long and a (very) short part?
>> Some average-thickness? Or something else?
>
> The problem is not with the broken slurs, but rather with the other slurs
> beginning on the second line. Look at the slurs on bars 15-16, 17-19, 20-23
> etc.
>
> Thanks
> Sharon


Ah, ok, got it.
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.

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-11 Thread Sharon Rosner
> Thus again: how should it look, in cases where a broken slur has a
> (very) long and a (very) short part?
> Some average-thickness? Or something else?

The problem is not with the broken slurs, but rather with the other slurs
beginning on the second line. Look at the slurs on bars 15-16, 17-19, 20-23
etc.

Thanks
Sharon



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


Re: Variable slur thickness

2016-03-11 Thread Thomas Morley
2016-03-11 1:18 GMT+01:00 Sharon Rosner <cico...@gmail.com>:
>> How should it look in situations like below?
>>
>> \score {
>> { c'1( \break d') \repeat unfold 12 { d' \noBreak } c'( \break c' d' c' d') }
>> \layout {
>>   \override Slur.after-line-breaking = #(variable-slur-thickness 3 10 1.4 
>> 12.7)
>> }
>> }
>
>
> I created something similar to show the problem. Looks to me like this has to 
> do with broken spanners but it’s really bizarre. See the enclosed files.
>
> Thanks
> Sharon
>

It's not bizarre, just how the current coding for
variable-slur-thickness works. In case of broken slurs, each part is
affected separately.
Thus again: how should it look, in cases where a broken slur has a
(very) long and a (very) short part?
Some average-thickness? Or something else?

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-10 Thread Sharon Rosner
> How should it look in situations like below?
> 
> \score {
> { c'1( \break d') \repeat unfold 12 { d' \noBreak } c'( \break c' d' c' d') }
> \layout {
>   \override Slur.after-line-breaking = #(variable-slur-thickness 3 10 1.4 
> 12.7)
> }
> }


I created something similar to show the problem. Looks to me like this has to 
do with broken spanners but it’s really bizarre. See the enclosed files.

Thanks
Sharon



slur.ly
Description: Binary data


slur.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-10 Thread Thomas Morley
2016-03-11 0:29 GMT+01:00 Sharon Rosner <cico...@gmail.com>:
> Hi Abraham,
>
> Putting this code into actual use, I found a show stopper. After a line
> break, the slur thickness stops being adjusted and reflects the default
> thickness value.
>
> Any idea?
>
> Sharon


How should it look in situations like below?

\score {
 { c'1( \break d') \repeat unfold 12 { d' \noBreak } c'( \break c' d' c' d') }
 \layout {
   \override Slur.after-line-breaking = #(variable-slur-thickness 3 10 1.4 12.7)
 }
}


Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-10 Thread Sharon Rosner
Hi Abraham,

Putting this code into actual use, I found a show stopper. After a line
break, the slur thickness stops being adjusted and reflects the default
thickness value.

Any idea?

Sharon



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


Re: Variable slur thickness

2016-03-10 Thread Thomas Morley
2016-03-10 17:14 GMT+01:00 tisimst <tisimst.lilyp...@gmail.com>:
>
> On Thu, Mar 10, 2016 at 9:04 AM, Malte Meyn-3 [via Lilypond] <[hidden
> email]> wrote:
>>
>>
>>
>> Am 10.03.2016 um 16:56 schrieb tisimst:
>> > Submitted to LSR: http://lsr.di.unimi.it/LSR/Item?id=1028
>> >
>>
>> The header of the third score isn’t correct: Thickness goes from 1.2 to
>> 2.7, not 1.4 to 2.7.
>
>
> (facepalm) Thanks. Corrected.
>
> - Abraham



Hi Abraham,

I had a look.
Pretty nice one, some nitpicks, though.

How about:

#(define (variable-slur-thickness min-l max-l min-t max-t)
  (lambda (grob)
(let* ((cpt (ly:grob-property grob 'control-points))
   (cp0 (car cpt))
   (cp3 (cadddr cpt))
;; dx/dy is clearer I think
   (dx (- (car cp3) (car cp0)))
   (dy (- (cdr cp3) (cdr cp0)))
;; avoids Pythagoras
   (len (magnitude (make-rectangular dx dy)))
;; avoids nested if
   (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
  (ly:grob-set-property! grob 'thickness thickness

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Inline images, was Re: Variable slur thickness

2016-03-10 Thread Brian Barker

At 10:56 10/03/2016 -0600, Matthew Skala wrote:

On Thu, 10 Mar 2016, Brian Barker wrote:

At 10:33 10/03/2016 -0600, Matthew Skala wrote:

... HTML in email is usually spam.


You are joking, of course!


No.


OK, I'll rephrase that to help you: either you *have to be* joking or 
you are plain wrong.


Brian Barker  



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Inline images, was Re: Variable slur thickness

2016-03-10 Thread mskala
On Thu, 10 Mar 2016, Brian Barker wrote:
> At 10:33 10/03/2016 -0600, Matthew Skala wrote:
> > ... HTML in email is usually spam.
>
> You are joking, of course!

No.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Inline images, was Re: Variable slur thickness

2016-03-10 Thread Brian Barker

At 10:33 10/03/2016 -0600, Matthew Skala wrote:

... HTML in email is usually spam.


You are joking, of course!

Brian Barker 



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Inline images, was Re: Variable slur thickness

2016-03-10 Thread tisimst
Pat,

On Thu, Mar 10, 2016 at 9:22 AM, Cynthia Karl [via Lilypond] <
ml-node+s1069038n188389...@n5.nabble.com> wrote:

> On Thu, 10 Mar 2016 06:04:57 -0700 (MST) tisimst <[hidden email]
> <http:///user/SendEmail.jtp?type=node=188389=0>> schrieb:
> >
> > HTH,
> > Abraham
> >
> > P.S. Some of the power users on this list filter inline images, so if
> you
> > wouldn't mind making the image an attachment next time, I know they'll
> > appreciate it. :-)
>
> Why on earth would anyone filter inline images?  They are extremely
> convenient.  They’re right there in the email, one doesn’t have to change
> context to a browser and interrupt the flow of reading the message.
>
> On the other hand, for me who gets the lilypond-user messages in the
> Digest form, attachments suck big time.  For example, below after the
> " next part “ line is a link to such an attachment (I think).
> When I click on that link, the result is:
>
> > Not Found
> >
> > The requested URL
> /archive/html/lilypond-user/attachments/20160310/4addc8f3/attachment.html
> was not found on this server.
>
> That’s not very convenient at all.  Am I the only one with this problem?
> What’s the solution?
>
> Maybe it would be nice if inline images were also added as attachments?
>

Frankly, you won't get any argument from me about having in-line images, I
just know that some other regular list followers have mentioned this in the
past. Perhaps doing both is how to satisfy both worlds, like you said?

Best,
Abraham




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


Re: Inline images, was Re: Variable slur thickness

2016-03-10 Thread mskala
On Thu, 10 Mar 2016, Cynthia Karl wrote:
> Why on earth would anyone filter inline images?

I filter HTML, because HTML in email is usually spam.  "Inline" images
imply HTML and thus get filtered too.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Inline images, was Re: Variable slur thickness

2016-03-10 Thread Cynthia Karl
On Thu, 10 Mar 2016 06:04:57 -0700 (MST) tisimst <tisimst.lilyp...@gmail.com> 
schrieb:
> 
> HTH,
> Abraham
> 
> P.S. Some of the power users on this list filter inline images, so if you
> wouldn't mind making the image an attachment next time, I know they'll
> appreciate it. :-)

Why on earth would anyone filter inline images?  They are extremely convenient. 
 They’re right there in the email, one doesn’t have to change context to a 
browser and interrupt the flow of reading the message.

On the other hand, for me who gets the lilypond-user messages in the Digest 
form, attachments suck big time.  For example, below after the " next 
part “ line is a link to such an attachment (I think).  When I click on 
that link, the result is:

> Not Found
> 
> The requested URL 
> /archive/html/lilypond-user/attachments/20160310/4addc8f3/attachment.html was 
> not found on this server.

That’s not very convenient at all.  Am I the only one with this problem?  
What’s the solution?   

Maybe it would be nice if inline images were also added as attachments?

Regards,
Pat Karl
> 
> --
> View this message in context: 
> http://lilypond.1069038.n5.nabble.com/Variable-slur-thickness-tp188374p188377.html
> Sent from the User mailing list archive at Nabble.com.
> -- next part --
> An HTML attachment was scrubbed...
> URL: 
> <http://lists.gnu.org/archive/html/lilypond-user/attachments/20160310/4addc8f3/attachment.html>
> 


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-10 Thread tisimst
On Thu, Mar 10, 2016 at 9:04 AM, Malte Meyn-3 [via Lilypond] <
ml-node+s1069038n18838...@n5.nabble.com> wrote:

>
>
> Am 10.03.2016 um 16:56 schrieb tisimst:
> > Submitted to LSR: http://lsr.di.unimi.it/LSR/Item?id=1028
> >
>
> The header of the third score isn’t correct: Thickness goes from 1.2 to
> 2.7, not 1.4 to 2.7.
>

(facepalm) Thanks. Corrected.

- Abraham




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


Re: Variable slur thickness

2016-03-10 Thread Malte Meyn



Am 10.03.2016 um 16:56 schrieb tisimst:

Submitted to LSR: http://lsr.di.unimi.it/LSR/Item?id=1028



The header of the third score isn’t correct: Thickness goes from 1.2 to 
2.7, not 1.4 to 2.7.


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Variable slur thickness

2016-03-10 Thread tisimst
On Thu, Mar 10, 2016 at 7:26 AM, Abraham Lee <tisimst.lilyp...@gmail.com>
wrote:

> On Thu, Mar 10, 2016 at 7:08 AM, Sharon Rosner [via Lilypond] <
> ml-node+s1069038n188378...@n5.nabble.com> wrote:
>
>> > I was thinking about this just yesterday. Here's a reasonable solution:
>>
>> Fantastic! I refactored the code to make it easier to change the
>> parameters:
>>
>
> +1. Nicely refactored.
>

Submitted to LSR: http://lsr.di.unimi.it/LSR/Item?id=1028

- Abraham




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


Re: Variable slur thickness

2016-03-10 Thread tisimst
On Thu, Mar 10, 2016 at 7:08 AM, Sharon Rosner [via Lilypond] <
ml-node+s1069038n188378...@n5.nabble.com> wrote:

> > I was thinking about this just yesterday. Here's a reasonable solution:
>
> Fantastic! I refactored the code to make it easier to change the
> parameters:
>

+1. Nicely refactored.

- Abraham




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


Re: Variable slur thickness

2016-03-10 Thread Sharon Rosner
> I was thinking about this just yesterday. Here's a reasonable solution:

Fantastic! I refactored the code to make it easier to change the parameters:


#(define (variable-slur-thickness min-l max-l min-t max-t) (lambda (grob)
  (let* ((cpt (ly:grob-property grob 'control-points))
 (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)))
 (ly:grob-set-property! grob 'thickness thickness)
  )
))

\layout {
  \override Slur.after-line-breaking = #(variable-slur-thickness 3 10 1.4
2.7)
}


> P.S. Some of the power users on this list filter inline images, so if you
> wouldn't mind making the image an attachment next time, I know they'll
> appreciate it. :-)

Thanks, will do!

Thanks,
Sharon



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


Re: Variable slur thickness

2016-03-10 Thread tisimst
Sharon,

On Thu, Mar 10, 2016 at 3:02 AM, Sharon Rosner [via Lilypond] <
ml-node+s1069038n18837...@n5.nabble.com> wrote:

> Would there be a way to change the slur thickness in proportion to its
> length, so short slurs will be thinner and longer ones will be thicker?
>

I was thinking about this just yesterday. Here's a reasonable solution:

%%

\version "2.19"

\layout {
  \context {
\Score
\override Slur.height-limit = 1.7
\override Slur.thickness = 2.8
\override Slur.line-thickness = 0.5
\override Slur.ratio = 0.2
  }
}

\paper {
  #(define page-breaking ly:one-line-auto-height-breaking)
}

\relative c' {
  \cadenzaOn
  c16[( d]) c[( d e]) c[( d e f]) c[( d e f g a]) c,[( d e f g a b c])
}

\layout {
  \override Slur.after-line-breaking =
#(lambda (grob)
   (let* ((cpt (ly:grob-property grob 'control-points))
  (cp0 (car cpt))
  (cp3 (cadddr cpt))
  (th (ly:grob-property grob 'thickness))
  (tip (ly:grob-property grob 'line-thickness))
  (x0 (car cp0))
  (y0 (cdr cp0))
  (x1 (car cp3))
  (y1 (cdr cp3))
  (len
(sqrt (+ (expt (- x1 x0)  2)
 (expt (- y1 y0)  2
  ;; Set the following FOUR values:
  ;; maxth = maximum desired thickness
  ;;   (default: Slur 'thickness)
  ;; minth = minimum desired thickness
  ;;   (default: 75% of maxth)
  ;; maxlen = maximum length of curve
  ;;   to interpolate between (lengths
  ;;   above this will have thickness
  ;;   of maxth)
  ;; minlen = minimum length of curve
  ;;   to interpolate between (lengths
  ;;   below this will have thickness
  ;;   of minth)
  (maxth th)
  (minth (* 0.75 maxth))
  (maxlen 10)
  (minlen 3)
  (newth
(if (<= len maxlen)
  (if (< len minlen)
 minth
 (+ minth
   (* (- len minlen)
 (/ (- maxth minth) (- maxlen minlen)
  maxth))
  )
 ;; For debugging purposes
 ;(format #t "***\n")
 ;(format #t "cp0: ~a\n" cp0)
 ;(format #t "cp3: ~a\n" cp3)
 ;(format #t "len: ~a\n" len)
 ;(format #t "th: ~a\n" th)
 ;(format #t "newth: ~a\n" newth)
 (ly:grob-set-property! grob 'thickness newth)
 ))
}

%%

HTH,
Abraham

P.S. Some of the power users on this list filter inline images, so if you
wouldn't mind making the image an attachment next time, I know they'll
appreciate it. :-)




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


Variable slur thickness

2016-03-10 Thread Sharon Rosner
Hi All

The following example shows slurs of variable length, engraved using a
bigger than normal thickness. The first slur looks a bit too thick, and I'm
having a hard time balancing the slur thickness so both short and long slurs
would look good.

<http://lilypond.1069038.n5.nabble.com/file/n188374/slur.png> 

Would there be a way to change the slur thickness in proportion to its
length, so short slurs will be thinner and longer ones will be thicker?

best
Sharon

slur.ly <http://lilypond.1069038.n5.nabble.com/file/n188374/slur.ly>  





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