In "C:\Users\franc\Documents\lilypond-2.24.4\share\lilypond\2.24.4\ly\
event-listener.ly"
I see the function *#(define (format-note engraver event)* which displays
information about "notes".
How to display these additional information ? :
- page number where the not is engraved
- x,y pixel position where the note is engraved in the png page

I have some difficulties locating the piece of documentation with all these
properties, and the way to use it...

Thank you for your cooperation
Franck Revolle
frevo...@gmail.com

Use-case : engrave score in png files,and follow the notes, for my freeware
Expresseur.com

Extract of the code to complete in event-listener.ly :

#(define (format-note engraver event)
   (let* ((origin (ly:input-file-line-char-column
                   (ly:event-property event 'origin)))
          (drum-type (ly:event-property event 'drum-type))
          (pitch (ly:event-property event 'pitch)))
     (print-line engraver
                 (if (ly:pitch? pitch)
                     "note"
                     "type")
                 (if (ly:pitch? pitch)
                     ;; get a MIDI pitch value.
                     (+ 60 (ly:pitch-semitones
                            (ly:event-property event 'pitch)))
                     drum-type)
                 (ly:duration->string
                  (ly:event-property event 'duration))
                 (format-moment (ly:duration-length
                                 (ly:event-property event 'duration)))
                 ;; point and click info
                 (ly:format "point-and-click ~a ~a"
                            (caddr origin)
                            (cadr origin)))))
code to complete to display page number, and x,y pixel position in the Png ?
*(ly:format "pos ~a ~a ~a"*
*                            (pageNumber ?)*
*                            (xPixel ?)*
                            (yPixel ?))

Reply via email to