lilypond-user
[Top][All Lists]
Advanced

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

Re: Extracting symbol location


From: David Nalesnik
Subject: Re: Extracting symbol location
Date: Mon, 26 Sep 2016 13:13:50 -0500

Hi Lukas,

On Fri, Sep 23, 2016 at 5:06 AM, Lukas Tuggener <address@hidden> wrote:
> Dear All
>
> To create labeled training data for a machine learning project, I need to
> extract the location at which symbols are printed. Is it possible to extract
> coordinates for every symbol? Methods which reveal the position of one
> symbol at a time would also already help a lot (e.g. control which symbol
> will be printed at the exact center)
>
> I am aware that similar questions have been asked have been asked in the
> past. But those are pretty old, so I am hoping that there has been some
> development in this area.
> (http://lists.gnu.org/archive/html/lilypond-user/2007-05/msg00142.html)
>

The link you cite mentions looking at SVG output, and I suppose that
would be the best way.  I can't think of another method to get the
actual print positions of objects.

I can't help with processing the SVG output to get the information you
want (a bounding box for each element?), but the attached file might
help with preparing an interpretable file.

Objects aren't assigned a unique id by default.  The attached tries to
do this.  Hopefully, the information included (grob name, moment,
horizontal and vertical coordinates) is sufficient.  The coordinates
used in the ID aren't the print position -- they are relative to the
system on which the grob is found, for one thing.  I include them to
distinguish between the note heads in a chord, which obviously occur
at the same time (moment).

There's a patch being reviewed which replaces the 'id property with
'output-properties and this will need to be updated accordingly
(https://sourceforge.net/p/testlilyissues/issues/4974/).

Hope this helps,
David

Attachment: svg-test.ly
Description: Text Data


reply via email to

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