lilypond-user
[Top][All Lists]
Advanced

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

How do I add balloonText to all notes with custom engraver?


From: RCJacH
Subject: How do I add balloonText to all notes with custom engraver?
Date: Thu, 26 Sep 2019 21:56:23 -0700 (MST)

I'm trying to use a custom engraver to programatically add a balloonTextItem
to every note in score.
I have done notehead coloring engraver through the help of
http://lsr.di.unimi.it/LSR/Snippet?id=572 and
http://lsr.di.unimi.it/LSR/Item?id=897, and notename display in
http://lsr.di.unimi.it/LSR/Item?id=818.

I got that the (minimum) code for defining a custom engraver is:

#(define **engraver**
   (make-engraver
    (acknowledgers
     ((note-head-interface engraver grob source-engraver)
      (let* ((context (ly:translator-context engraver))
            (**other local variables**))
        (**code**)
        )))))

Now the problem is that I cannot find anything related to balloonText...

For editing existing properties, one would use (ly:grob-set-property! grob
'property assignment) in **code** block; I've seen scripts adding stencils
with (ly:stencil-add) in http://lsr.di.unimi.it/LSR/Item?id=969.

I've used \displayMusic for \displayMusic { c-\balloonText #'(2 . 0) "1"}
and showed following scheme code in the console, with lines related to
balloonText in bold:

(make-music
  'SequentialMusic
  'elements
  (list (make-music
          'NoteEvent
          'articulations
          **(list (make-music
                  'AnnotateOutputEvent
                  'text
                  "1"
                  'Y-offset
                  0
                  'X-offset
                  2))**
          'pitch
          (ly:make-pitch -1 0 0)
          'duration
          (ly:make-duration 0 0 1))))


Now my question is how do I fit the balloonText block into the engraver
scheme, so that it is added to each note in the staff?



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

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