lilypond-user
[Top][All Lists]
Advanced

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

Re: Precise locating rendered items


From: Jacek Gajek
Subject: Re: Precise locating rendered items
Date: Mon, 27 Jun 2011 10:52:04 +0200

> Jacek,
> ________________________________________
> From: address@hidden address@hidden on behalf of Jacek Gajek address@hidden
> Sent: 26 June 2011 23:06
> To: lilypond-user
> Subject: Precise locating rendered items
>
> Hello!
>
> I am developing an app in which user should be capable to place notes
> on a staff. I don't want to implement a whole rendering engine, I
> decided to use lilypond. Now.
>
> My idea is to allow user to place notes by clicking on a prerendered
> image by lily. All I need is to determine where did the user clicked.
> Is it possible to get such characteristics from lily? Of course I
> could scan an image and find staff lines etc., but that would be
> implementation-dependant and ugly, so I would prefer to gather
> objects' locations directly from lily. Is it possible?
>
> -----
>
> I am sure you will get other answers from people that know the code more. 
> However by default, in case you were not aware the PDF files that are 
> generated have links on the musical notes (as an example) that allow a user 
> to click on the PDF and take it back directly to the .ly source.
>
> See:
>
> http://lilypond.org/doc/v2.14/Documentation/notation/available-music-functions#index-pointAndClickOn
>
> However I don't have much experience with the code of this, there are also a 
> couple of old threads
>
> http://thread.gmane.org/gmane.comp.gnu.lilypond.devel/33382/focus=33390
>
> is one.
>
> I have done a quick look about the old devel and user lists but have not come 
> up with anything else, but I know that a couple of people had asked for this 
> or discussed this in the last 2 years with regard to generating clickable SVG 
> as well as HTML output.
>
> Maybe one of the others (Carl (who I see has had some dealings with the 
> original 'pointAndClickOn' function) and Mike (who is part of the thread 
> above)) can give you some guidelines?
>
> James
>
I use C#. I think that using PDF or PNG generator is too slow. To make
such control interactive in both ways (selecting notes, drag&drop
them, quickly insert some rests in the middle of staff etc. etc.),
generator is not a way to go. I think about soft like Guitar Pro, or
Finale. The best thing would be a (likely strongly-typed) object which
would containt entities which appear on a staff. In which I could
write: "staff.AddNote(someNoteObject);". This is a PowerShell
approach. I don't know much about internal lilypond architecture, but
if it's OO then maybe it is possible to expose an interface to the
outside world.



reply via email to

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