lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting a markup command to generate a curve from a pair of points


From: Kevin Barry
Subject: getting a markup command to generate a curve from a pair of points
Date: Sun, 15 Mar 2015 20:48:57 +0000

Hi LilyPond experts,

I'm trying to make a function that will draw a curved line given only a destination point (with some math I'll add later), but I've hit an early stumbling block: I can't seem to substitute variables for values in the path/curveto command list. The following code produces a `wrong-argument-type' error, but it points to scm/stencil.scm which isn't very helpful for figuring out what's wrong. Help appreciated!

\version "2.18.2"

#(define-markup-command (draw-curved-line layout props points)
   (number-pair?)
   (let ((xpt (car points))
         (ypt (cdr points)))
     (interpret-markup layout props
       (markup #:path 1 '((curveto 0 ypt 0 ypt xpt ypt))))))

\relative {
  b_\markup { \draw-curved-line #'(5 . 5) }
}

reply via email to

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