lilypond-user
[Top][All Lists]
Advanced

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

Slur over a single note


From: Urs Liska
Subject: Slur over a single note
Date: Mon, 25 Feb 2019 12:03:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

Hi,

I'm in need of an idea how to approach this: I need to print a slur over a single note.

More concretely there already is a markup with a certain width above the note (see attached image), and I need to print a slur over that markup (see second attached image).

It should be possible (I think) to hook into the stencil callback, take the markup stencil and produce a new slur stencil from scratch. But until now I have only taken an existing slur stencil and worked with that, so I'm at a loss as to how I can add a new slur stencil to the existing one.

I've come to the point where I can access the markup as a stencil in the "stencil" override. From here I want to add an additional slur stencil, aligned to that markup stencil and add it to the whole resul.

Any pointers would be welcome
Urs

\version "2.21.0"

#(define (tremulo-type? obj)
   (and (symbol? obj)
        (memq obj '(slow accel fast))))

tremulo =
#(define-event-function (type)(tremulo-type?)
   (let*
    ((markups
      `((accel .
          ,#{
            \markup \concat {
              \fontsize #1
              \musicglyph "scripts.prall"
              \fontsize #-1
              \musicglyph "scripts.prallprall"
            }
          #})))
     ;; store the actually used markup in a closure
     (use-markup (assq-ref markups type)))
    #{
      \tweak stencil
      #(lambda (grob)
         (let*
          ((tremulo-stencil (grob-interpret-markup grob use-markup))
           )
           ; TODO:
           ; Create slur stencil and add/align it above the tremulo
           tremulo-stencil
           ))
      ^\markup ""
    #}
    ))

{
  c''1 \tremulo accel
}

Attachment: 1756_241_2.png
Description: PNG image

Attachment: neue-vorlage-seitenkorrekt.png
Description: PNG image


reply via email to

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