On 2024-04-01 3:47 am, Maurits Lamers via Discussions on LilyPond development wrote:
Hey all,

I also asked this question on the lilypond-user mailing list, but I gather it is a rather complex question for that list. As you might be aware, I have been working on a braille extension for Lilypond which (based on the music info extraction example) renders Lilypond scores into music braille.

While the listener system works great for extracting musical information, it doesn't provide any methods to extract text inserted outside of the music context.

In my specific case, I am trying to convert a songbook, which has the format of printing one verse of a song with the music notation, and with the remainder of the song text as \markup text blocks below the music.

Is there any way that I could extract this text in order to include it with the generated braille? The preferred solution should be as transparent as the listener system is for the musical information.

Thanks in advance!


Easiest option would probably be to tie into the `toplevel-text-handler`:

%%%%
\version "2.25.13"

#(let ((original-proc toplevel-text-handler))
  (set! toplevel-text-handler (lambda (markup)
    (format #t "~a\n" (markup->string markup))
    (original-proc markup))))

\markup \column {
  \line { \bold { Lorem ipsum } dolor sit amet, }
  \line { \italic consectetur adipiscing elit. }
}
%%%%


-- Aaron Hill

  • extracting markup t... Maurits Lamers via Discussions on LilyPond development
    • Re: extracting... Aaron Hill
      • Re: extrac... Maurits Lamers via Discussions on LilyPond development

Reply via email to