lilypond-user
[Top][All Lists]
Advanced

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

Re: Changing stem stencil


From: Urs Liska
Subject: Re: Changing stem stencil
Date: Fri, 28 Feb 2014 18:36:52 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0

Am 28.02.2014 14:33, schrieb Peter Bjuhr:

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
}


Now that I've seen this works:
It would be extremely cool if you could write a blog post about how one can create custom stuff using Bravura like this. I think there are some possible uses for that (e.g. clusters). Noeck's posts clearly point in that direction already, but if we had another post showing how you can actually _do_ it ...

And you should consider making this a snippet for our repo.

Best
Urs



reply via email to

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