lilypond-user
[Top][All Lists]
Advanced

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

Re: Introducing "LilyPond HTML Live Score"


From: Richard Shann
Subject: Re: Introducing "LilyPond HTML Live Score"
Date: Mon, 30 Nov 2015 16:27:47 +0000

On Mon, 2015-11-30 at 14:56 +0100, Mathieu Demange wrote:
> Hi Richard,
> 
> The ideal approach would have been to have a timing information
> directly inserted in the svg output by LilyPond itself but I tried
> everything I could to obtain such a result with no luck. I posted here
> about that topic but I didn't get any clue.
> 
> So I figured out I'd do it myself.
> 
> I was able to set a grob's ID dynamically and put its "origin" (point
> and click information) in it : that was a way to later reference a
> unique notehead or rest.
> 
> On the other side, the event listener (based on the event-listener.ly
> file bundled with LilyPond) allowed me to get an approximate timing
> information and another "origin" which I could then couple to the
> first one.
[...]
> 
> The script then injects extra HTML5 attributes to the svg code.
> 
> The JavaScript part gather all noteheads and rests <g> tags and
> creates an array of objects which is then sorted chronologically (svg
> objects are laid out in a way which is not chronological at all).
> 
> Hope this answers even partially to your curiosity :)

Thank you, this goes a little beyond mere curiosity in fact - I just
spent a few days looking at this problem and was just about to abandon
it. Can I ask for an overview of the flow you use?
I can see a 

score.ly

containing the regular LilyPond score and 

live-score.ily

I guess to make the LilyPond executable do things on encountering notes,
rests etc

and I see a python script which seems (I don't speak python!) to take a
file
events.txt

and output a file

score.svg

Is the rest (js) a matter of confabulating the svg from LilyPond with
that score.svg file and an audio file to make the webpage?

Richard







reply via email to

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