Jump to content

Flat ties: Difference between revisions

From LilyPond wiki
Rewrite description and examples
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 37: Line 37:
                 (xtrans (car xex))
                 (xtrans (car xex))
                 (ytrans (if (> dir 0)(car yex) (cdr yex)))
                 (ytrans (if (> dir 0)(car yex) (cdr yex)))
;; Add last point.
                ;; Add last point.
(coord-list (append coords '((1.0 . 0.0))))
                (coord-list (append coords '((1.0 . 0.0))))
                 (uplist
                 (uplist
                 (map pair-to-list
                 (map pair-to-list
                       (normalize-coords coord-list lenx (* leny 2) dir))))
                       (normalize-coords coord-list lenx (* leny 2) dir))))
           (ly:stencil-translate
           (ly:stencil-translate
    (my-c-p-s uplist used-thick)
            (my-c-p-s uplist used-thick)
    (cons xtrans ytrans)))
            (cons xtrans ytrans)))
         '())))
         '())))


Line 75: Line 75:


   <>^\markup \small \typewriter
   <>^\markup \small \typewriter
             "\shape #'((0 . 0) (0 . -1) (0 . -1) (0 . 0))"
             "\\shape #'((0 . 0) (0 . -1) (0 . -1) (0 . 0))"
   \shape #'((0 . 0) (0 . -1) (0 . -1) (0 . 0)) Tie
   \shape #'((0 . 0) (0 . -1) (0 . -1) (0 . 0)) Tie
   a4~ a
   a4~ a

Latest revision as of 11:28, 1 March 2026

This snippet provides a function flared-tie to draw a tie that consist of straight lines. It is intended as a replacement for the default tie-drawing function (i.e., a replacement argument for the stencil property of the Tie grob).

The argument of flared-tie is a list of coordinate pairs that specify additional points between the first and last point to span up the tie’s lines. The first and last point are identical to the original tie’s start and end point, respectively. The X and Y coordinate values are multiples of the bounding box length and height of the original tie (also taking care of the tie’s direction); consequently, the first point has coordinates (0,0), and the last point (1,0).

The function flare-tie defines a shorthand for a flat tie. Further tweaking of the shape is possible by overriding Tie.details.height-limit or with \shape. It is also possible to change the custom definition on the fly.

LilyPond rendering error

No release of LilyPond 2.24 found.