[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display the control points of a slur
From: |
Aaron Hill |
Subject: |
Re: Display the control points of a slur |
Date: |
Wed, 13 Nov 2019 07:00:31 -0800 |
User-agent: |
Roundcube Webmail/1.3.8 |
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
control-points.cropped.png
Description: PNG image
- 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 <=
- Re: Display the control points of a slur, Jan-Peter Voigt, 2019/11/13
- 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