Yeah I figured using event-listener.ly wasn’t likely to work, because that was too easy. This other thing that you linked is hella complicated. It also does many things that I don’t need to do. All I need out of this is a text file just like the one that comes from event listener, except with X and Y. Everything else I can handle myself, with ffmpeg and my own code. So basically, the issue is that what you gave me is overkill for what I’m trying to do, and I don’t have a prayer of understanding it well enough to just rip out the part that I need. I don’t even know where it’s supposed to go. Chris On Thursday, December 7, 2023 at 01:05:21 AM GMT+1, Jean Abou Samra <j...@abou-samra.fr> wrote:
Thanks for your reply. Regarding scheme code: it seems to me that the simplest solution would be to modify event-listener.ly so that instead of storing point-and-click data (row and column within the lily file), it instead stores the pixel coordinate X, Y of the note’s (or rest’s) glyph within the output PNG image. I have tried that, but so far my efforts are not successful, due to my weak understanding of the language and LilyPond’s data architecture. I would happily accept a “cookbook” solution for the above, as this would spare me countless hours of possibly futile effort. Any reason not to reuse the code I linked inside ly2video as a cookbook solution? Anything implementing this sort of functionality is basically bound to use the same kind of technique. Note that you cannot extend event-listener.ly to output coordinates because event listeners in engravers are run during the translation process where LilyPond converts the music to a net of graphical objects, long before those objects are placed on the page. It may help to read this if you want to understand the different phases of compilation. You want grob callbacks, which is what that code does. Re MusicXML, can you recommend a FOSS MIDI to MusicXML converter that runs on Windows? Have you tried MuseScore's import then export? Last time I looked, this seemed to be the most accurate.