lilypond-user
[Top][All Lists]
Advanced

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

Change stem stencil


From: Jon Arnold
Subject: Change stem stencil
Date: Mon, 22 May 2017 21:19:50 -0500

Hi-

I am trying to notate a harp string muffle like here: https://s3.amazonaws.com/cdn.harpcenter.com/images/extras/MufflesEx10R10.jpg

I found a script by Peter Bjuhr that successfully replaces the stem (modified for glyph I need): https://lists.gnu.org/archive/html/lilypond-user/2014-02/msg00665.html
#(define (muffle-stem grob)
    (if (ly:stencil? (ly:stem::print grob))
      (let* ((stencil (ly:stem::print grob))
             (X-ext (ly:stencil-extent stencil X))
             (Y-ext (ly:stencil-extent stencil Y))
             (width (interval-length X-ext))
             (len (interval-length Y-ext)))

        (ly:stencil-translate
          (grob-interpret-markup grob
            (markup #:smuflglyph "stemDamp"))
          (cons 0 (interval-start Y-ext))))
      #f))

My only problem is that the Smufl glyph doesn't flip vertically with the stem, so it doesn't look right on down-stems. Can anyone help enhance the script to account for stem direction?

Thanks so much-

Jon Arnold


reply via email to

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