lilypond-user
[Top][All Lists]
Advanced

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

Re: Changing stem stencil


From: Peter Bjuhr
Subject: Re: Changing stem stencil
Date: Fri, 28 Feb 2014 14:33:46 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0


On 2014-02-27 20:44, Peter Bjuhr wrote:
Hello,

I have a question about changing stems. In my case it's related to an exploration of using SMuFL Fonts in LilyPond, which are made available in the openLilyLib snippets repository by Joram Berger and Nathan Ho. I would like to take the opportunity to thank them both!

[...]

Any guidance will be appreciated!


I found this http://lsr.di.unimi.it/LSR/Snippet?id=864, and thanks to that I managed to set up this script:

\include "../smufl/definitions.ily"

#(define (PendereckiTremolo-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 "stemPendereckiTremolo"))
         (cons 0 (interval-start Y-ext))))
     #f))

 \relative c'{
  \override Stem #'stencil = #PendereckiTremolo-stem
  f4 b c e
}

But if anybody wants to try this remember that it will only work with the addition of the SMuFL script in the openLilyLib snippets repository https://github.com/openlilylib/snippets/tree/master/custom-music-fonts/smufl

Best
Peter

reply via email to

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