lilypond-user
[Top][All Lists]
Advanced

[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:18:15 -0800
User-agent: Roundcube Webmail/1.3.8

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

Attachment: control-points.cropped.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]