lilypond-devel
[Top][All Lists]
Advanced

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

Re: A snippet for editing curves using the mouse and reporting changes t


From: Urs Liska
Subject: Re: A snippet for editing curves using the mouse and reporting changes to the .ly file
Date: Mon, 16 Dec 2019 10:18:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

Hi Paolo,

I have followed the discussion but didn't have the time to actually test your code until today.

First of all let me state that this is really great, and when I will raise some issue these are in no way meant as critique. I really want to see this integrated in the toolbox in one way or another, but there are a few minor and major questions that should be answered before.

Regarding integration in Frescobaldi I agree that it's appropriate to create an independent version of the code and then have Frescobaldi deal with it.

Generally I'd say this functionality should be integrated in LilyPond itself, and I hope we'll find a version that satisfies all potential questions. What Werner Lemberg hinted at when mentioning my name was that we could alternatively or additionally include the snippet in the openLilyLib package oll-misc (https://github.com/openlilylib/oll-misc/). While I prefer having it in LilyPond proper you should understand that any addition we do now will most surely *not* be included in the next stable release 2.20 but will only be available through the next development version. Judging from recent history version 2.22 may be quite some way in the future. For me this won't be an issue since I'm always using the development version, but if we want this functionality to be generally available we might better include it in LilyPond itself and then *additionally* to openLilyLib.

Now to the functionality itself. Again, the length of the list of comments should not diminish my excitement about your code!

 * For integration in LilyPond the functionality should be wrapped into
   a single file that can be included. Including the file should
   automatically activate the functionality.
   Maybe there should be a second includable file that does *not*
   automatically activate the functionality but provides a command to
   selectively switch it on and off or apply it to only one curve.
   There may be people who don't want the whole score to be polluted
   with the control points but only see the slur they want to edit.
 * The behavior of the script in the SVG file is too intrusive IMHO.
     o forcing the interface with the pop-up prevents any external
       contexts (like e.g. Frescobaldi) from accessing the
       functionality in the way they need to. There should be some way
       to interact with the data in a different way. Also, it should be
       possible to get to the raw data instead of the formatted \shape
       command string.
     o It seems the function prevents point-and-click from working. I
       assume this is related to your decision to “hijack” the context
       menu functionality.
     o If that's correct (or even if not) I think the context menu
       should not be blocked in this way. Probably it's a better
       approach to *add* an entry. Maybe this is also a usable hook for
       external programs to integrate your function.
 * There is one flaw in the behaviour: When you include the generated
   \shape command in the score and recompile the modified slur is drawn
   correctly (which is totally great!). However, when you now modify
   that slur again (which is a very reasonable expectation) the \shape
   command is now calculated relatively to the already-applied \shape,
   so *now* the recompilation will produce a totally unexpected result.
   I see two possible solutions:
     o Somehow determine if a \shape has already been applied to the
       slur and consider the values when generating a new \shape. I
       have no idea whether this is possible.
     o Don't use  \shape at all but finally integrate \shapeII into
       LilyPond and use it for the graphical tweaking. With \shapeII it
       is possible to much more robustly shape a slur than with \shape,
       and it is somewhat more absolute. I've attached the
       documentation PDF, and you can find the code at
       
https://github.com/openlilylib/snippets/tree/master/notation-snippets/shaping-bezier-curves/shapeII
       (don't let the warnings scare you when compiling the example file).
       There would be some figuring out how to best apply the function,
       starting from the approach of polar coordinates, I'd say.
       To make it work, the function would have to do some more
       calculations that simply measuring the offsets, but I'm
       convinced it would be more than worth the effort.

Best
Urs

Am 16.12.19 um 03:42 schrieb Paolo Prete:
Hello,

the snippet attached to this mail allows the tuning with the mouse of the
curves generated by Lilypond so that the changes can be reflected on the
original .ly file.
The tuning is done on the generated SVG file, as explained in this thread
(but you can look at the code of the attached file, there's a mini how-to
and it's very simple to use):

https://lists.gnu.org/archive/html/lilypond-user/2019-12/msg00217.html

Since the snippet is incompatible with Lilypond 2.18 it cannot be included
in the snippets repository of that version, as explained by Thomas (it
would be bad to downgrade the code).
Is it possible to include it in the development version, then?

(I also ask Aaron to revise the indentation / length of lines of the Scheme
code)
The snippet has had very positive feedbacks, and should not be left without
a future, IMHO. I believe it can define a template for the tuning of many
other properties of graphic objects, in a very simple way both for the
Lilypond user and for those who want to extend the procedure through
Javascript.

In the Lilypond user ml they suggested to include it in Frescobaldi or
Denemo; but I don't think it's the best solution. Because, being the
snippet 100% lilypond native code, it does not need any additional tool to
work, and demonstrates the potential of Lilypond in generating interactive
SVG. To be more precise, given that it is 100% Lilypond, Frescobaldi and
Denemo should recognize it automatically.
It is also true, as Carl states, that LilyPond is not intended to be a
WYSIWYG software; but I believe that the "tuning" through GUI is not
opposed to this vision but integrates it, especially considering that the
GUI is generated by Lilypond itself.

Best,
Paolo

Attachment: example.pdf
Description: Adobe PDF document


reply via email to

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