lilypond-user
[Top][All Lists]
Advanced

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

Re: Getting absolute position of objects


From: Knut Petersen
Subject: Re: Getting absolute position of objects
Date: Sun, 10 Sep 2017 12:45:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0


I also need to output the absolute coordinates of all objects on the page, to generate training data for optical music recognition. I'm trying to print some information in \applyOutput, and I see that NoteHead X-offset and Y-offset are 0, and X-parent, Y-parent, X-positions, and Y-positions all seem to be (). Is there a way to get the absolute coordinates, so that I can add them to event-listener.ly?


It certainly is possible, but you need to implement an after-line-breaking function. There you can access the paper variables (margins etc.) as well as the xy-position of grobs. You may have a look at videohelper.ily file I published on this list on 2017-07-21. There is a function mkvideo-dump that easily could be extended to meet your requirements.

Knut


reply via email to

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