lilypond-user
[Top][All Lists]
Advanced

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

Re: Locating X/Y positions of staves and bars in PNG output


From: Urs Liska
Subject: Re: Locating X/Y positions of staves and bars in PNG output
Date: Mon, 21 Apr 2014 09:16:01 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Am 21.04.2014 09:09, schrieb Mike Solomon:
On Apr 21, 2014, at 1:17 AM, David Hinkle <address@hidden> wrote:

I'm working on a new GPL web application designed to help new people learn to 
sing using the new FFT capabilities of HTML5.  (Git hub links below if you're 
interested).

I'd like to use Lilypond to generate scores for display in the app.  In order 
to show the user the feedback about where they're singing I'd like to 
superimpose that feedback on the score, but I need to know the X/Y positions of 
the bars and staves.

I'm willing to go so far as to modify Lilypond to export this information when 
it generates an PNG but I'd like to ask the list first if they have any other 
ideas, and if not, maybe they could point me to the best place to start 
tinkering with Lilypond source to get the information exported.

My Proof of concept:
https://github.com/drachs/singingPractice

A live example of precisely identifying the frequency of a tone and displaying 
it on a staff.  Blue line is the precise frequency based on a curve fit of the 
FFT, red bars are fft output.   White lines are bass and treble clef staff 
lines.  (Staff lines are spread further out as the frequency gets higher

https://rawgit.com/drachs/singingPractice/2d53330f77122a435063b57dd5322418851510a4/notedisplay.html

LilyPond may not be the best tool to do what you want.

For short examples, check out the GUIDO server.

http://guidoeditor.grame.fr

It sends scores to a server in realtime and recuperates either a canvas or a 
png (http://guidoeditor.grame.fr/png.html).  The public API has methods that 
generate what are called
Time2GraphicMap, which give you this type of XY information.

GUIDO is available at http://sourceforge.net/p/guidolib/code/ci/master/tree/.

For LilyPond, I’d recommend using the SVG to get data about where things are 
placed globally.

Yes, this could give you the information you need, in addition you _might_ be able to use JavaScript to post-process the results in the browser.

You may have a look at
https://github.com/PeterBjuhr/frescobaldi/tree/svg-edit/frescobaldi_app/svgview

and particularly
https://github.com/PeterBjuhr/frescobaldi/blob/svg-edit/frescobaldi_app/svgview/editsvg.js

to get a feeling what might be possible.
This is a completely different task but it shows you the interaction between JavaScript and a LilyPond-SVG. You may start reading the DraggableObject constructor.

HTH
Urs


Cheers,
MS



_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user





reply via email to

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