[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display the control points of a slur
From: |
Jan-Peter Voigt |
Subject: |
Re: Display the control points of a slur |
Date: |
Wed, 13 Nov 2019 16:18:02 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
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
- Display the control points of a slur, Paolo Prete, 2019/11/13
- Re: Display the control points of a slur, Urs Liska, 2019/11/13
- Re: Display the control points of a slur, Paolo Prete, 2019/11/13
- Re: Display the control points of a slur, Aaron Hill, 2019/11/13
- Re: Display the control points of a slur,
Jan-Peter Voigt <=
- Re: Display the control points of a slur, Aaron Hill, 2019/11/13
- Re: Display the control points of a slur, Paolo Prete, 2019/11/14
- Re: Display the control points of a slur, Aaron Hill, 2019/11/14
- Re: Display the control points of a slur, Urs Liska, 2019/11/15
- Re: Display the control points of a slur, Urs Liska, 2019/11/15