Re: Feature request: Display bezier control-points

2012-05-04 Thread James
Hello,

On 4 May 2012 01:31, Urs Liska lilyli...@googlemail.com wrote:
 Am 04.05.2012 02:08, schrieb David Nalesnik:

 Hi Urs,

     It would be a really valuable feature if one could let LilyPond
    display
     the control-points of a bezier curve.
     I would imagine something like a cross or a point at the middle two
     control-points.


 I think this would be very helpful, so that you can visualize exactly what
 these control-points are that you're setting.  (It must be a common
 misconception that they are points on the actual curve.)

 I'm not sure what impact this may have on the layout, but you could do
 something like the following:

 \version 2.15.37

 #(define (make-cross-stencil coords)
  (ly:stencil-add
    (make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
    (make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
  (+ (car coords) 0.2) (- (cdr coords) 0.2

 #(define display-control-points
  (lambda (grob)
    (let ((stencil (ly:slur::print grob))
          (cps (ly:grob-property grob 'control-points)))
      (ly:stencil-add stencil
     (make-cross-stencil (second cps))
     (make-cross-stencil (third cps))
 \relative c'' {
  \override Slur #'stencil = #display-control-points
  c( d e f)
 }

 Hope you find this helpful!

 Wow, extremely!
 Of course I would prefer to have this built-in.
 And as you I can't really judge if this has side effects.
 But this really _is_ helping to find suitable values for the control-points.

  * Although I know bezier curves from vector graphics software, I also
   was convinced that the 'control-points' were four points on the
   curve that define its shape.
  * In fact the first and last are such points, whereas the middle two
   'control-points' are the 'handles'.
   - Is this explained somewhere?

http://lilypond.org/doc/v2.14/Documentation/notation-big-page.html#modifying-ties-and-slurs

?

James

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


Re: Feature request: Display bezier control-points

2012-05-04 Thread Urs Liska

Am 04.05.2012 08:09, schrieb James:

Hello,

On 4 May 2012 01:31, Urs Liskalilyli...@googlemail.com  wrote:

Am 04.05.2012 02:08, schrieb David Nalesnik:


Hi Urs,

  It would be a really valuable feature if one could let LilyPond
display
  the control-points of a bezier curve.
  I would imagine something like a cross or a point at the middle two
  control-points.


I think this would be very helpful, so that you can visualize exactly what
these control-points are that you're setting.  (It must be a common
misconception that they are points on the actual curve.)

I'm not sure what impact this may have on the layout, but you could do
something like the following:

\version 2.15.37

#(define (make-cross-stencil coords)
  (ly:stencil-add
(make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
(make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
  (+ (car coords) 0.2) (- (cdr coords) 0.2

#(define display-control-points
  (lambda (grob)
(let ((stencil (ly:slur::print grob))
  (cps (ly:grob-property grob 'control-points)))
  (ly:stencil-add stencil
 (make-cross-stencil (second cps))
 (make-cross-stencil (third cps))
\relative c'' {
  \override Slur #'stencil = #display-control-points
  c( d e f)
}

Hope you find this helpful!

Wow, extremely!
Of course I would prefer to have this built-in.
And as you I can't really judge if this has side effects.
But this really _is_ helping to find suitable values for the control-points.

  * Although I know bezier curves from vector graphics software, I also
   was convinced that the 'control-points' were four points on the
   curve that define its shape.
  * In fact the first and last are such points, whereas the middle two
   'control-points' are the 'handles'.
   -  Is this explained somewhere?

http://lilypond.org/doc/v2.14/Documentation/notation-big-page.html#modifying-ties-and-slurs

OK, that's a thorough explanation ...
I must have read this - but probably I didn't understand it then and 
therefore forgot it more effectively than if I hadn't seen it at all ;-)


Best
Urs


?

James



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


Re: Feature request: Display bezier control-points

2012-05-04 Thread Urs Liska

Am 04.05.2012 03:09, schrieb Thomas Morley:

Hi Urs,


I would be very happy about one or two more features (that I unfortunately
can't implement myself:
- highlight (and separate from the music) the crosses through a color
- possibly adding a connecting (very thin) line, making it even more
intuitive

Best
Urs

how about:

\version 2.14.2

#(define (make-cross-stencil coords)
  (ly:stencil-add
(make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
   (+ (car coords) 0.2) (+ (cdr coords) 0.2))
(make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
   (+ (car coords) 0.2) (- (cdr coords) 0.2

#(define (display-control-points line)
  (lambda (grob)
(let ((stencil (ly:slur::print grob))
  (cps (ly:grob-property grob 'control-points)))

(ly:stencil-add stencil
  (ly:stencil-in-color
  (make-cross-stencil (second cps))
  1 0 0)
  (ly:stencil-in-color
  (make-cross-stencil (third cps))
  1 0 0)
  (if (eq? line #t)
  (make-line-stencil 0.05 (car (second cps)) (cdr (second cps))
(car (third cps))  (cdr (third cps)))
  empty-stencil)
  )
  )))

\relative c'' {
  \override Slur #'stencil = #(display-control-points #t)
  c2( d e f)
}


HTH,
   Harm

Hi Harm,

thanks for this.
What I had in mind was to draw lines from control-points 1-2 and 3-4 (as 
in drawing programs).
Your solution is equally intuitive, but I have the impression that 'my' 
lines are generally smaller and therefore less intrusive, especially 
with longer curves.


See the attached updated file.
In it you can see also:
- it equally works with broken slurs
- the lines are important: Take the control-point 2 of the slur in m. 2. 
It is already hard to tell if this belongs to the first or the second 
line - an ambiguity that isn't present in the second version with the lines.


There are two more issues with this:
- I don't see how to get it working with ties. Which would be nice of course
- It would be nice to be able to pass the color as a (optional) list of 
values. So one could store the main function in a library file and 
define the appearance in a 'user space' wrapper function (like in the 
attached file). And it would make it possible to differentiate colors 
for slurs, phrasingSlurs and Ties.


If we could continue to get a set of working tools (together with 
David's shapeXXX functions), I'd try hard to find the time to document 
it in some kind of tutorial (although currently I have to finish the 
'real-life' project I need all this for ...)


Best
Urs
\version 2.14.2

#(define (make-cross-stencil coords)
 (ly:stencil-add
   (make-line-stencil 0.15 (- (car coords) 0.2) (- (cdr coords) 0.2)
  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
   (make-line-stencil 0.15 (- (car coords) 0.2) (+ (cdr coords) 0.2)
  (+ (car coords) 0.2) (- (cdr coords) 0.2

#(define (display-control-points line)
 (lambda (grob)
   (let ((stencil (ly:slur::print grob))
 (cps (ly:grob-property grob 'control-points)))

   (ly:stencil-add stencil
 (ly:stencil-in-color
 (make-cross-stencil (second cps))
 0 0 1)
 (ly:stencil-in-color
 (make-cross-stencil (third cps))
 0 0 1)
 (if (eq? line #t)
 (make-line-stencil 0.05 
(car (first cps)) (cdr (first cps))
(car (second cps))  (cdr (second cps)))
 empty-stencil)
 (if (eq? line #t)
 (make-line-stencil 0.05 
(car (third cps)) (cdr (third cps))
(car (fourth cps))  (cdr (fourth cps)))
 empty-stencil)
 )
 )))

displayControlPoints = {
  \override Slur #'stencil = #(display-control-points #f)
  \override PhrasingSlur #'stencil = #(display-control-points #f)
  %\override Tie #'stencil = #(display-control-points #f) % commenting this out 
gives an error
}

displayControlPointsWithLines = {
  \override Slur #'stencil = #(display-control-points #t)
  \override PhrasingSlur #'stencil = #(display-control-points #t)
  %\override Tie #'stencil = #(display-control-points #t) % commenting this out 
gives an error
}

hideControlPoints = {
  \revert Slur #'stencil 
  \revert PhrasingSlur #'stencil
}

\paper { indent = 0 }

music = \relative c'' {
  \slurDown
  c2\( d e d( c d~ d f) 
  \break
  g e c d c1\)
}
  
\markup Show control-points
\score {
  {
\displayControlPoints
\music
  }
}

\markup Show control-points and 'handle' lines
\score {
  {
\displayControlPointsWithLines
\music
  }
}

\markup Plain curves
\score {
  {
\music
  }
}___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Feature request: Display bezier control-points

2012-05-04 Thread Urs Liska

Am 04.05.2012 04:12, schrieb David Nalesnik:


Hi Urs,


But this really _is_ helping to find suitable values for the
control-points.


I'm very glad to hear this!


 * Although I know bezier curves from vector graphics software, I
   also was convinced that the 'control-points' were four
points on
   the curve that define its shape.


Initially I did too...

 * In fact the first and last are such points, whereas the
middle two
   'control-points' are the 'handles'.
   - Is this explained somewhere?
 * From seeing the crosses I now realize that (when using your
   function) all four offsets are relative to LilyPond's original
   decision.
   Well, if you think about it, that's quite obvious, but I always
   assumed that if I change one offset the other
control-points would
   be affected accordingly.
   But in fact they aren't. So if I for example raise the
endpoint of
   a slur, the third control-point may well get below the slur.
   This makes me understand the seemingly strange behaviour of the
   slurs when fiddling with the offsets. 


 * - Probably it'll greatly improve my 'tweaking experience',
even
   if I have seen this only once, not to speak if I manage to
include
   this in a real-life workflow ...
   So, many thanks once more, David!


You're very welcome!  I've been playing around with it a bit myself, 
and I'm becoming more and more convinced that something like this 
would be a very useful feature.


You can also use it to show you the effect of changing other 
properties.  For example, you can see the effects of overriding 
'height-limit and 'eccentricity.  I'm finding it very instructive.


At least one thing, which I did do right now:
I compiled one score with and without your cross setting, and
comparing the two pdfs with Alt-Tab showed that the layout was
perfectly identical - except for the additional crosses.
So obviously the crosses are added after LilyPond decides about
the layout.


I'm very glad to hear this!  My worry was that the crosses might push 
staves further apart in extreme situations.
Now I checked this and was glad to see that the crosses/lines happily 
print over adjacent staves without influencing them at all. Which is 
another point for using it together with the lines.


I think your shapeXXX functions together with this option make a _very_ 
useful toolset for working with curves.
I will gladly try to package this in some way and do anything to help 
making it accessible (if not directly within the LilyPond site then 
maybe through a tutorial)


Best
Urs

Best
Urs


Thanks for trying this out!

-David



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


Re: Feature request: Display bezier control-points

2012-05-04 Thread Thomas Morley
Hi Urs,

 There are two more issues with this:
 - I don't see how to get it working with ties. Which would be nice of course

works with Ties now. Can't do more for now. I have to go to my regular job. :(

\version 2.14.2

#(define (make-cross-stencil coords)
 (ly:stencil-add
   (make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
   (make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
  (+ (car coords) 0.2) (- (cdr coords) 0.2

#(define (display-control-points line)
 (lambda (grob)
   (let* ((grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
  (name (grob-name grob))
  (stil (cond ((or (eq? name 'Slur)(eq? name
'PhrasingSlur))(ly:slur::print grob))
  ((eq? name 'Tie)(ly:tie::print grob
  (cps (ly:grob-property grob 'control-points)))

  (ly:stencil-add stil
(ly:stencil-in-color
  (ly:stencil-add
 ;(make-cross-stencil (first cps))
 (make-cross-stencil (second cps))
 (make-cross-stencil (third cps))
 ;(make-cross-stencil (fourth cps))
 )
 1 0 0)

 (if (eq? line #t)
 (begin
  (ly:stencil-add
   (make-line-stencil 0.05 (car (first cps)) (cdr (first cps))
(car (second cps))  (cdr (second cps)))
   ;(make-line-stencil 0.05 (car (second cps)) (cdr (second
cps)) (car (third cps))  (cdr (third cps)))
   (make-line-stencil 0.05 (car (third cps)) (cdr (third cps))
(car (fourth cps))  (cdr (fourth cps)))
   ))
 empty-stencil)
 )
 )))

\relative c'' {
 \override Slur #'stencil = #(display-control-points #t)
 c2( d e f)
 \override PhrasingSlur #'stencil = #(display-control-points #t)
 c2\( d e f\)
 \override Tie #'stencil = #(display-control-points #t)
 e2~ e
}

-Harm

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


Re: Feature request: Display bezier control-points

2012-05-03 Thread Ralph Palmer
On Thu, May 3, 2012 at 7:14 PM, Urs Liska lilyli...@googlemail.com wrote:

 Sorry if I should be asking for something that is already possible, but at
 least I don't know of it ...

 Tweaking slurs and similar curves is a matter of trial and error, although
 David's functions that expect offsets instead of hardcoded control-points
 greatly simplify it.

 It would be a really valuable feature if one could let LilyPond display
 the control-points of a bezier curve.
 I would imagine something like a cross or a point at the middle two
 control-points.

 It should be settable through e.g.
\paper { display-control-points = ##t }
 (like annotate-spacing)

 Is that of general interest?
 And does it look complicated?

 Best
 Urs


Greetings, Urs and list members :

Your request for an enhancement has been submitted as issue 2510 :
http://code.google.com/p/lilypond/issues/detail?id=2510

Enjoy your music writing/transcribing/playing,

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


Re: Feature request: Display bezier control-points

2012-05-03 Thread David Nalesnik
Hi Urs,

 It would be a really valuable feature if one could let LilyPond display
  the control-points of a bezier curve.
  I would imagine something like a cross or a point at the middle two
  control-points.


I think this would be very helpful, so that you can visualize exactly what
these control-points are that you're setting.  (It must be a common
misconception that they are points on the actual curve.)

I'm not sure what impact this may have on the layout, but you could do
something like the following:

\version 2.15.37

#(define (make-cross-stencil coords)
  (ly:stencil-add
(make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
   (+ (car coords) 0.2) (+ (cdr coords) 0.2))
(make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
   (+ (car coords) 0.2) (- (cdr coords) 0.2

#(define display-control-points
  (lambda (grob)
(let ((stencil (ly:slur::print grob))
  (cps (ly:grob-property grob 'control-points)))

  (ly:stencil-add stencil
  (make-cross-stencil (second cps))
  (make-cross-stencil (third cps))

\relative c'' {
  \override Slur #'stencil = #display-control-points
  c( d e f)
}

Hope you find this helpful!

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


Re: Feature request: Display bezier control-points

2012-05-03 Thread David Nalesnik
On Thu, May 3, 2012 at 7:08 PM, David Nalesnik david.nales...@gmail.comwrote:

 Hi Urs,

  It would be a really valuable feature if one could let LilyPond display
  the control-points of a bezier curve.
  I would imagine something like a cross or a point at the middle two
  control-points.


 I think this would be very helpful, so that you can visualize exactly what
 these control-points are that you're setting.  (It must be a common
 misconception that they are points on the actual curve.)



Of course, you can use the slur tweak tool in LilyPondTool!

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


Re: Feature request: Display bezier control-points

2012-05-03 Thread Urs Liska

Am 04.05.2012 02:08, schrieb David Nalesnik:

Hi Urs,

 It would be a really valuable feature if one could let LilyPond
display
 the control-points of a bezier curve.
 I would imagine something like a cross or a point at the middle two
 control-points.


I think this would be very helpful, so that you can visualize exactly 
what these control-points are that you're setting.  (It must be a 
common misconception that they are points on the actual curve.)


I'm not sure what impact this may have on the layout, but you could do 
something like the following:


\version 2.15.37

#(define (make-cross-stencil coords)
  (ly:stencil-add
(make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
(make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
  (+ (car coords) 0.2) (- (cdr coords) 0.2

#(define display-control-points
  (lambda (grob)
(let ((stencil (ly:slur::print grob))
  (cps (ly:grob-property grob 'control-points)))
  (ly:stencil-add stencil
 (make-cross-stencil (second cps))
 (make-cross-stencil (third cps))
\relative c'' {
  \override Slur #'stencil = #display-control-points
  c( d e f)
}

Hope you find this helpful!

Wow, extremely!
Of course I would prefer to have this built-in.
And as you I can't really judge if this has side effects.
But this really _is_ helping to find suitable values for the control-points.

 * Although I know bezier curves from vector graphics software, I also
   was convinced that the 'control-points' were four points on the
   curve that define its shape.
 * In fact the first and last are such points, whereas the middle two
   'control-points' are the 'handles'.
   - Is this explained somewhere?
 *  From seeing the crosses I now realize that (when using your
   function) all four offsets are relative to LilyPond's original decision.
   Well, if you think about it, that's quite obvious, but I always
   assumed that if I change one offset the other control-points would
   be affected accordingly.
   But in fact they aren't. So if I for example raise the endpoint of a
   slur, the third control-point may well get below the slur.
   This makes me understand the seemingly strange behaviour of the
   slurs when fiddling with the offsets.
 * - Probably it'll greatly improve my 'tweaking experience', even if
   I have seen this only once, not to speak if I manage to include this
   in a real-life workflow ...
   So, many thanks once more, David!

I'll test this together with your new offset function (I intended to do 
it this very evening, but it has become sooo late now (here in Central 
Europe) ...


Best
Urs



-David




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


Re: Feature request: Display bezier control-points

2012-05-03 Thread Urs Liska

Am 04.05.2012 02:31, schrieb Urs Liska:

Am 04.05.2012 02:08, schrieb David Nalesnik:

Hi Urs,

 It would be a really valuable feature if one could let LilyPond
display
 the control-points of a bezier curve.
 I would imagine something like a cross or a point at the middle two
 control-points.


I think this would be very helpful, so that you can visualize exactly 
what these control-points are that you're setting.  (It must be a 
common misconception that they are points on the actual curve.)


I'm not sure what impact this may have on the layout, but you could 
do something like the following:


\version 2.15.37

#(define (make-cross-stencil coords)
  (ly:stencil-add
(make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
(make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
  (+ (car coords) 0.2) (- (cdr coords) 0.2

#(define display-control-points
  (lambda (grob)
(let ((stencil (ly:slur::print grob))
  (cps (ly:grob-property grob 'control-points)))
  (ly:stencil-add stencil
 (make-cross-stencil (second cps))
 (make-cross-stencil (third cps))
\relative c'' {
  \override Slur #'stencil = #display-control-points
  c( d e f)
}

Hope you find this helpful!

Wow, extremely!
Of course I would prefer to have this built-in.
And as you I can't really judge if this has side effects.
But this really _is_ helping to find suitable values for the 
control-points.


  * Although I know bezier curves from vector graphics software, I
also was convinced that the 'control-points' were four points on
the curve that define its shape.
  * In fact the first and last are such points, whereas the middle two
'control-points' are the 'handles'.
- Is this explained somewhere?
  * From seeing the crosses I now realize that (when using your
function) all four offsets are relative to LilyPond's original
decision.
Well, if you think about it, that's quite obvious, but I always
assumed that if I change one offset the other control-points would
be affected accordingly.
But in fact they aren't. So if I for example raise the endpoint of
a slur, the third control-point may well get below the slur.
This makes me understand the seemingly strange behaviour of the
slurs when fiddling with the offsets.
  * - Probably it'll greatly improve my 'tweaking experience', even
if I have seen this only once, not to speak if I manage to include
this in a real-life workflow ...
So, many thanks once more, David!

I'll test this together with your new offset function (I intended to 
do it this very evening, but it has become sooo late now (here in 
Central Europe) ...



At least one thing, which I did do right now:
I compiled one score with and without your cross setting, and comparing 
the two pdfs with Alt-Tab showed that the layout was perfectly identical 
- except for the additional crosses.

So obviously the crosses are added after LilyPond decides about the layout.
So tomorrow I will incorporate all this into my set-up (in a way that in 
'draft mode' display-control-points is active by default)


I would be very happy about one or two more features (that I 
unfortunately can't implement myself:

- highlight (and separate from the music) the crosses through a color
- possibly adding a connecting (very thin) line, making it even more 
intuitive


Best
Urs


Best
Urs



-David






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


Re: Feature request: Display bezier control-points

2012-05-03 Thread Thomas Morley
Hi Urs,

 I would be very happy about one or two more features (that I unfortunately
 can't implement myself:
 - highlight (and separate from the music) the crosses through a color
 - possibly adding a connecting (very thin) line, making it even more
 intuitive

 Best
 Urs

how about:

\version 2.14.2

#(define (make-cross-stencil coords)
 (ly:stencil-add
   (make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
   (make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
  (+ (car coords) 0.2) (- (cdr coords) 0.2

#(define (display-control-points line)
 (lambda (grob)
   (let ((stencil (ly:slur::print grob))
 (cps (ly:grob-property grob 'control-points)))

   (ly:stencil-add stencil
 (ly:stencil-in-color
 (make-cross-stencil (second cps))
 1 0 0)
 (ly:stencil-in-color
 (make-cross-stencil (third cps))
 1 0 0)
 (if (eq? line #t)
 (make-line-stencil 0.05 (car (second cps)) (cdr (second cps))
(car (third cps))  (cdr (third cps)))
 empty-stencil)
 )
 )))

\relative c'' {
 \override Slur #'stencil = #(display-control-points #t)
 c2( d e f)
}


HTH,
  Harm

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


Re: Feature request: Display bezier control-points

2012-05-03 Thread David Nalesnik
Hi Urs,


 But this really _is_ helping to find suitable values for the
 control-points.


I'm very glad to hear this!



  * Although I know bezier curves from vector graphics software, I
also was convinced that the 'control-points' were four points on
the curve that define its shape.


Initially I did too...


  * In fact the first and last are such points, whereas the middle two
'control-points' are the 'handles'.
- Is this explained somewhere?
  * From seeing the crosses I now realize that (when using your
function) all four offsets are relative to LilyPond's original
decision.
Well, if you think about it, that's quite obvious, but I always
assumed that if I change one offset the other control-points would
be affected accordingly.
But in fact they aren't. So if I for example raise the endpoint of
a slur, the third control-point may well get below the slur.
This makes me understand the seemingly strange behaviour of the
slurs when fiddling with the offsets.

  * - Probably it'll greatly improve my 'tweaking experience', even
if I have seen this only once, not to speak if I manage to include
this in a real-life workflow ...
So, many thanks once more, David!


You're very welcome!  I've been playing around with it a bit myself, and
I'm becoming more and more convinced that something like this would be a
very useful feature.

You can also use it to show you the effect of changing other properties.
 For example, you can see the effects of overriding 'height-limit and
'eccentricity.  I'm finding it very instructive.

At least one thing, which I did do right now:
 I compiled one score with and without your cross setting, and comparing
 the two pdfs with Alt-Tab showed that the layout was perfectly identical -
 except for the additional crosses.
 So obviously the crosses are added after LilyPond decides about the layout.


I'm very glad to hear this!  My worry was that the crosses might push
staves further apart in extreme situations.

Thanks for trying this out!

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


Re: Feature request: Display bezier control-points

2012-05-03 Thread David Nalesnik
Hi Harm,


 how about:

 \version 2.14.2

 #(define (make-cross-stencil coords)
  (ly:stencil-add
   (make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
   (make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
  (+ (car coords) 0.2) (- (cdr coords) 0.2

 #(define (display-control-points line)
  (lambda (grob)
   (let ((stencil (ly:slur::print grob))
 (cps (ly:grob-property grob 'control-points)))

   (ly:stencil-add stencil
  (ly:stencil-in-color
 (make-cross-stencil (second cps))
 1 0 0)
 (ly:stencil-in-color
 (make-cross-stencil (third cps))
 1 0 0)
 (if (eq? line #t)
 (make-line-stencil 0.05 (car (second cps)) (cdr (second cps))
 (car (third cps))  (cdr (third cps)))
 empty-stencil)
 )
 )))

 \relative c'' {
  \override Slur #'stencil = #(display-control-points #t)
  c2( d e f)
 }


Looks great!  Makes this even more fun to play around with :)

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