Re: Display the control points of a slur

2019-11-15 Thread Urs Liska



Am 15.11.19 um 11:18 schrieb Urs Liska:

What I'd find interesting in addition would be:

- visualizing extra-offset (by plotting a line between the final and 
the original refpoints)



What I would also love to see (but can't really imagine being possible) 
is any offset that has been automatically applied due to collision 
avoidance.





Re: Display the control points of a slur

2019-11-15 Thread Urs Liska



Am 15.11.19 um 00:06 schrieb Aaron Hill:

On 2019-11-14 2:20 pm, Paolo Prete wrote:

I propose to include your snippet in a new release of Lilypond because
it's very useful.


It would be nice to include more debug annotations within LilyPond.  
If I am not mistaken, we currently have the following options:


  \paper { annotate-spacing = ##t }
  #(ly:set-option 'debug-skylines)
  \override [Non]PaperColumn.stencil = #ly:paper-column::print

For the future, we could add support for these cases:

- Plotting curve control points.
- Visualizing the extents and origins of grob stencils.
- Indicating the relationships between grobs (i.e. parents, children, 
siblings).


Are there other annotations that folks would find helpful? Providing 
there is enough interest in such support, we should open a ticket for 
tracking the work.



Frescobaldi also offers the following options (in the Layout Control Tool):

- coloring voices with explicit \voiceXXX
  (unfortunately implicit ones in polyphonic settings are not possible)
- coloring explicit directions with ^ or _
- print the grob names

What I'd find interesting in addition would be:

- visualizing extra-offset (by plotting a line between the final and the 
original refpoints)
- visualizing *other* properties of bezier curves, for example angles 
and ratios
  (those that can be set with \shapeII). These are of course not 
available as properties

  but would have to be calculated.
  The results should be printed in a semi-transparent (?) rectangle 
overlaying the score
- in a similar vein there could be a more generic function to "debug" a 
grob by printing
  selected property values on top of the score (something like a ballon 
text, but overlaid)


These visualizations should also be possible to switch on and off in the 
course of the document to just apply them to a selected range or even a 
single item.


Urs





-- Aaron Hill





Re: Display the control points of a slur

2019-11-14 Thread Aaron Hill

On 2019-11-14 2:20 pm, Paolo Prete wrote:

I propose to include your snippet in a new release of Lilypond because
it's very useful.


It would be nice to include more debug annotations within LilyPond.  If 
I am not mistaken, we currently have the following options:


  \paper { annotate-spacing = ##t }
  #(ly:set-option 'debug-skylines)
  \override [Non]PaperColumn.stencil = #ly:paper-column::print

For the future, we could add support for these cases:

- Plotting curve control points.
- Visualizing the extents and origins of grob stencils.
- Indicating the relationships between grobs (i.e. parents, children, 
siblings).


Are there other annotations that folks would find helpful?  Providing 
there is enough interest in such support, we should open a ticket for 
tracking the work.



-- Aaron Hill



Re: Display the control points of a slur

2019-11-14 Thread Paolo Prete
 Thanks very much Aaron,
I propose to include your snippet in a new release of Lilypond because it's 
very useful.
Il mercoledì 13 novembre 2019, 16:19:29 CET, Aaron Hill 
 ha scritto:  
 
 On 2019-11-13 7:00 am, Aaron Hill wrote:
> On 2019-11-13 6:32 am, Paolo Prete wrote:
>> Hello,
>> I wonder if is there a script or a snippet for doing that without
>> using Frescobaldi
> 
> Probably not perfect, but here's something you can fiddle with:

Updated to ensure the stencil's extents are the same as the original 
also using a slightly cleaner approach:


\version "2.19.83"

showControlPoints = #(grob-transformer 'stencil (lambda (grob orig)
  (define (draw-control-point pt)
    #{ \markup \translate $pt \with-color #red \draw-circle #0.2 #0 ##t 
#})
  (define (draw-control-segment pt1 pt2)
    (let ((delta (cons (- (car pt2) (car pt1)) (- (cdr pt2) (cdr 
pt1)
      #{ \markup \translate $pt1 \with-color #'(1 .5 0) \draw-line 
$delta #}))
  (let* ((pts (ly:grob-property grob 'control-points))
          (dots (map draw-control-point pts))
          (lines (map draw-control-segment pts (cdr pts
    (grob-interpret-markup grob #{
      \markup \with-dimensions-from \stencil $orig \overlay {
        \overlay { $@lines } \overlay { $@dots } \stencil $orig } #}

\layout { \context { \Voice
  \override PhrasingSlur.stencil = #showControlPoints
  \override Slur.stencil = #showControlPoints
  \override Tie.stencil = #showControlPoints
} }

\fixed c' { e4\( b2._~ | b2( e'8 c') a4\) }



-- Aaron Hill  

Re: Display the control points of a slur

2019-11-13 Thread Jan-Peter Voigt
Hi Aaron,

thank you for this nice snippet!

Jan-Peter

Am 13.11.19 um 16:00 schrieb Aaron Hill:
> On 2019-11-13 6:32 am, Paolo Prete wrote:
>> Hello,
>> I wonder if is there a script or a snippet for doing that without
>> using Frescobaldi
>
> Probably not perfect, but here's something you can fiddle with:
>
> 
> \version "2.19.83"
>
> showControlPoints = #(grob-transformer 'stencil (lambda (grob orig)
>   (define (draw-control-point pt)
>     #{ \markup \translate $pt \with-color #red \draw-circle #0.15 #0 ##t
> #})
>   (define (draw-control-segment pt1 pt2)
>     (let ((delta (cons (- (car pt2) (car pt1)) (- (cdr pt2) (cdr pt1)
>   #{ \markup \translate $pt1 \with-color #'(1 .5 0) \draw-line
> $delta #}))
>   (let* ((pts (ly:grob-property grob 'control-points))
>  (dots (map (lambda (pt)
>     (grob-interpret-markup grob (draw-control-point pt)))
>     pts))
>  (lines (map (lambda (pt1 pt2)
>     (grob-interpret-markup grob (draw-control-segment pt1 pt2)))
>     pts (cdr pts
>     (ly:stencil-add
>   (apply ly:stencil-add lines)
>   (apply ly:stencil-add dots)
>   orig
>
> \layout { \context { \Voice
>   \override PhrasingSlur.stencil = #showControlPoints
>   \override Slur.stencil = #showControlPoints
>   \override Tie.stencil = #showControlPoints
> } }
>
> \fixed c' { g4\( a b2~ | b2( e'8 d') c'4\) }
> 
>
>
> -- Aaron Hill




Re: Display the control points of a slur

2019-11-13 Thread Aaron Hill

On 2019-11-13 7:00 am, Aaron Hill wrote:

On 2019-11-13 6:32 am, Paolo Prete wrote:

Hello,
I wonder if is there a script or a snippet for doing that without
using Frescobaldi


Probably not perfect, but here's something you can fiddle with:


Updated to ensure the stencil's extents are the same as the original 
also using a slightly cleaner approach:



\version "2.19.83"

showControlPoints = #(grob-transformer 'stencil (lambda (grob orig)
  (define (draw-control-point pt)
#{ \markup \translate $pt \with-color #red \draw-circle #0.2 #0 ##t 
#})

  (define (draw-control-segment pt1 pt2)
(let ((delta (cons (- (car pt2) (car pt1)) (- (cdr pt2) (cdr 
pt1)
  #{ \markup \translate $pt1 \with-color #'(1 .5 0) \draw-line 
$delta #}))

  (let* ((pts (ly:grob-property grob 'control-points))
 (dots (map draw-control-point pts))
 (lines (map draw-control-segment pts (cdr pts
(grob-interpret-markup grob #{
  \markup \with-dimensions-from \stencil $orig \overlay {
\overlay { $@lines } \overlay { $@dots } \stencil $orig } #}

\layout { \context { \Voice
  \override PhrasingSlur.stencil = #showControlPoints
  \override Slur.stencil = #showControlPoints
  \override Tie.stencil = #showControlPoints
} }

\fixed c' { e4\( b2._~ | b2( e'8 c') a4\) }



-- Aaron Hill

Re: Display the control points of a slur

2019-11-13 Thread Aaron Hill

On 2019-11-13 6:32 am, Paolo Prete wrote:

Hello,
I wonder if is there a script or a snippet for doing that without
using Frescobaldi


Probably not perfect, but here's something you can fiddle with:


\version "2.19.83"

showControlPoints = #(grob-transformer 'stencil (lambda (grob orig)
  (define (draw-control-point pt)
#{ \markup \translate $pt \with-color #red \draw-circle #0.15 #0 ##t 
#})

  (define (draw-control-segment pt1 pt2)
(let ((delta (cons (- (car pt2) (car pt1)) (- (cdr pt2) (cdr 
pt1)
  #{ \markup \translate $pt1 \with-color #'(1 .5 0) \draw-line 
$delta #}))

  (let* ((pts (ly:grob-property grob 'control-points))
 (dots (map (lambda (pt)
(grob-interpret-markup grob (draw-control-point pt)))
pts))
 (lines (map (lambda (pt1 pt2)
(grob-interpret-markup grob (draw-control-segment pt1 pt2)))
pts (cdr pts
(ly:stencil-add
  (apply ly:stencil-add lines)
  (apply ly:stencil-add dots)
  orig

\layout { \context { \Voice
  \override PhrasingSlur.stencil = #showControlPoints
  \override Slur.stencil = #showControlPoints
  \override Tie.stencil = #showControlPoints
} }

\fixed c' { g4\( a b2~ | b2( e'8 d') c'4\) }



-- Aaron Hill

Re: Display the control points of a slur

2019-11-13 Thread Paolo Prete
 Hello,
I wonder if is there a script or a snippet for doing that without using 
Frescobaldi

Il mercoledì 13 novembre 2019, 15:29:45 CET, Urs Liska 
 ha scritto:  
 
 Frescobaldi provides this with the Tools=>Layout Control mode. However chances 
are that it's broken in a versio accessible to you.

Urs


Am 13. November 2019 15:22:05 MEZ schrieb Paolo Prete :
Hello,
please consider this snippet:

\relative c'' {  \shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 . -5.5)) 
PhrasingSlur  c8\( e b f d' a e g\)}

Is there a helper function or some script for displaying the control points of 
the slur (for example with a red color)? Is it possible to display the 
coordinates near the points too?
I found that:
openlilylib/oll-misc

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
openlilylib/oll-misc

Miscellaneous tools and functions for LilyPond. Contribute to 
openlilylib/oll-misc development by creating an ac...
 |

 |

 |





But I can't figure how to use it in the previous snippet...

Thanks

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.  

Re: Display the control points of a slur

2019-11-13 Thread Urs Liska
Frescobaldi provides this with the Tools=>Layout Control mode. However  chances 
are that it's broken in a versio  accessible to you.

Urs


Am 13. November 2019 15:22:05 MEZ schrieb Paolo Prete :
>Hello,
>please consider this snippet:
>
>\relative c'' {  \shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 .
>-5.5)) PhrasingSlur  c8\( e b f d' a e g\)}
>
>Is there a helper function or some script for displaying the control
>points of the slur (for example with a red color)? Is it possible to
>display the coordinates near the points too?
>I found that:
>openlilylib/oll-misc
>
>| 
>| 
>| 
>|  |  |
>
> |
>
> |
>| 
>|  | 
>openlilylib/oll-misc
>
>Miscellaneous tools and functions for LilyPond. Contribute to
>openlilylib/oll-misc development by creating an ac...
> |
>
> |
>
> |
>
>
>
>
>
>But I can't figure how to use it in the previous snippet...
>
>Thanks

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

Display the control points of a slur

2019-11-13 Thread Paolo Prete
Hello,
please consider this snippet:

\relative c'' {  \shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 . -5.5)) 
PhrasingSlur  c8\( e b f d' a e g\)}

Is there a helper function or some script for displaying the control points of 
the slur (for example with a red color)? Is it possible to display the 
coordinates near the points too?
I found that:
openlilylib/oll-misc

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
openlilylib/oll-misc

Miscellaneous tools and functions for LilyPond. Contribute to 
openlilylib/oll-misc development by creating an ac...
 |

 |

 |





But I can't figure how to use it in the previous snippet...

Thanks