openlilylib / snippets

A place to store useful pieces of LilyPond code - custom functions, engravers, hacks, templates, examples etc.
Other
119 stars 39 forks source link

The \shapeII function causes warnings #171

Closed soundsfromsound closed 4 years ago

soundsfromsound commented 4 years ago

Hello,

I believe there may be a problem with using shapeII currently. I've tested this a few different ways and can't figure out how to fix the problem. Please consider this code:

%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.19.83"
\language "english"
\include "oll-core/package.ily"
\loadModule snippets.notation-snippets.shaping-bezier-curves.shapeII

\relative {
   \time 12/8
   \stemDown
   <e' c'>8 <e df'> <e_~ c'>^( <e bf'> <f af>) <f\=1
   -\shapeII #'((0 . -.7)(p 30 .4)(p 30 .4)(20.6 . -3.7)) _( bf>(
     <e\=1) c'> <e df'>) <e_~ c'>^( <e bf'> <f af>) <af bf> |
     \stemDown
   <e' c'>8 <e df'> <e_~ c'>^( <e bf'> <f af>) <f\=1
   -\shapeII #'((0 . -.7)(p 30 .4)(p 30 .4)(.2 . -.7)) _( bf>(
     <e\=1) c'> <e df'>) <e_~ c'>^( <e bf'> <f af>) <af bf>
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

It seems no matter what I try there are always warning messages in my log file when trying to use the shapeII function. Although it appears as though you can edit the slurs and they do indeed respond to the values you input, the warnings still persist. (see image)

For testing, I simulated a new user to LilyPond:

I installed a fresh virtual machine, installed unstable LilyPond, cloned a fresh copy of openlilylib, and added it to the path in Frescobaldi as I have done in my production machine. All files are located by Frescobaldi correctly and the paths are correct.

With everything appearing to be configured correctly as far as I can tell, is this an issue with oll-core? Is it safe to ignore these warnings?

Here is the log output from the code above when I run it in Frescobaldi 3: (note that the "not found" .ily file does exist in the correct location)

=======
Log output:

Processing `C:/Users/Ben/Desktop/file.ly'

Parsing...
/openlilylib/snippets/notation-snippets/shaping-bezier-curves/shapeII/module.ily:2:10: 
error: cannot find file: `ly/_internal/utilities/lilypond-version-predicates.ily'

\include "ly/_internal/utilities/lilypond-version-predicates.ily"

C:/Users/Ben/Desktop/file.ly:13:5: warning:

openLilyLib. DEPRECATION:
Using 'lilypond-less-than?' from oll-core is deprecated. 
openLilyLib explicitly does not suppport LilyPond 2.18 anymore, 
so users are expected to use the development version 2.19 or a later stable release. 
Since LilyPond 2.19.57 the version predicate 'ly:version?' 
is included in LilyPond, and all uses of 'lilypond-less-than?' should properly be 
replaced with that.

\shapeII #'((0 . -.7)(p 30 .4)(p 30 .4)(20.6 . -3.7)) _( bf>(

C:/Users/Ben/Desktop/file.ly:17:5: warning:

openLilyLib. DEPRECATION:
Using 'lilypond-less-than?' from oll-core is deprecated. 
openLilyLib explicitly does not suppport LilyPond 2.18 anymore, 
so users are expected to use the development version 2.19 or a later stable release. 
Since LilyPond 2.19.57 the version predicate 'ly:version?' 
is included in LilyPond, and all uses of 'lilypond-less-than?' should properly be 
replaced with that.

\shapeII #'((0 . -.7)(p 30 .4)(p 30 .4)(.2 . -.7)) _( bf>(

Completed successfully in 0.8".

More information here: http://lilypond.1069038.n5.nabble.com/Slurring-into-another-voice-without-breaking-a-beam-td224318.html

shapeii_warning

uliska commented 4 years ago

First: Do I understand right that the resulting shape of the slur in the image is "correct" (i.e. shows the expected strange results just to show that the function does something? The following assumes the answer to this is "yes".

I admit there are some inconsistencies here.

For LilyPond to successfully find that missing file you'll have to add /openlilylib/snippets/ to the search path (in Frescobaldi: Edit=>Preferences=>LilyPond Preferences).

However, since you use openLilyLib through including oll-core and then using \loadModule you should not be needing that, so it is a kind of bug. BUT: please consider the whole openlilylib/snippets repository as deprecated. This is the original repository basically everybody could throw snippets at, essentially that's a LSR with Git.

My intention was (and in theory still is) to move everything of interest to some new and more organized location, i.e. in a more specific package. \shapeII has been moved to the bezier package, and replacing

\loadModule snippets.notation-snippets.shaping-bezier-curves.shapeII

with

\loadModule bezier.shapeII

should give you the function without warnings.

Please close the issue if you find the answer satisfying, or please tell me what you think should be done about the situation.

soundsfromsound commented 4 years ago

First: Do I understand right that the resulting shape of the slur in the image is "correct" (i.e. shows the expected strange results just to show that the function does something? The following assumes the answer to this is "yes".

Yes. I just wanted to show that the shape of the slur does indeed change correctly according to the given values.

I admit there are some inconsistencies here.

For LilyPond to successfully find that missing file you'll have to add /openlilylib/snippets/ to the search path (in Frescobaldi: Edit=>Preferences=>LilyPond Preferences).

You are right. I did add the snippets directory explicitly in Frescobaldi and now the code I posted above runs correctly with no warnings whatsoever.

However, since you use openLilyLib through including oll-core and then using \loadModule you should not be needing that, so it is a kind of bug.

That's what I was thinking - I thought it was "correct" to only need to add the openlilylib folder to Frescobaldi's path and then use the newer approach - loadModule.

BUT: please consider the whole openlilylib/snippets repository as deprecated. This is the original repository basically everybody could throw snippets at, essentially that's a LSR with Git.

Oh, it is? Sorry. I didn't see that I guess. I only saw this at the bottom of all the listed repositories for openlilylib:

openlilylib Deprecated -> see openlilylib/snippets

So I thought snippets itself was the replacement for the deprecated older repo...? Should users stop using snippets and use a different repo?

\shapeII has been moved to the bezier package, and replacing

\loadModule snippets.notation-snippets.shaping-bezier-curves.shapeII

with

\loadModule bezier.shapeII

should give you the function without warnings.

Yes. Using only \loadModule bezier.shapeII does work, but I guess at this point I'm still a bit confused. Which repos do you suggest "installing" / cloning and adding to path when using with LilyPond?

As of now, I only have been installing: oll-core, oll-misc, and snippets (and now bezier).

Thanks!

uliska commented 4 years ago

Oh, it is? Sorry. I didn't see that I guess. I only saw this at the bottom of all the listed repositories for openlilylib

So I thought snippets itself was the replacement for the deprecated older repo...?

Well, that is also true, historically...

Should users stop using snippets and use a different repo?

Not at this point. What should be (and that's where I'll have to look for a "bug fix") is that in cases like \shapeII, i.e. functions/modules that already have been ported elsewhere, there should be a proper deprecation warning in the log output, telling you to use Y instead of X. At one point everything should be ported somewhere else, then the deprecation would be issued at a higher level, i.e. when any module from snippets is loaded. But it's not totally realistic to expect this to happen soon enough.

Which repos do you suggest "installing" / cloning and adding to path when using with LilyPond?

oll-core and oll-misc are the bread-and-butter core of openLilyLib. These should at least be installed, and the common root added to the search path. (The fact that you have to add another package path explicitly is a bug).

Everything else depends (like is typical for an extensions infrastructure) on what you need. Looking at the repositories list I once more realize we desperately need a website where packages can be described in more detail. Some of them are heavy packages, some are helpers, others are stubs that can't really be used yet.

Some suggestions to have a look at:

uliska commented 4 years ago

@soundsfromsound could you please check with #172 and tell me if you think that's adequate? (Don't forget to remove the search path include that you added as a workaround.

I assume there are a number of other modules that should then get this deprecation warning.

soundsfromsound commented 4 years ago

@soundsfromsound could you please check with #172 and tell me if you think that's adequate? (Don't forget to remove the search path include that you added as a workaround.

I assume there are a number of other modules that should then get this deprecation warning.

Looks great to me. Thank you so much. Yes, I've now removed the workaround search path reference for the snippets and just have my normal openlilylib only. This code works without warnings or errors.

%%%%%%%%%%%%%%%%%%%%%%%%%% \version "2.19.83" \language "english" \include "oll-core/package.ily" \loadModule bezier.shapeII

\relative { \time 12/8 \stemDown <e' c'>8 <e df'> <e~ c'>^( <e bf'> ) <f\=1 -\shapeII #'((0 . -.7)(p 30 .4)(p 30 .4)(20.6 . -3.7)) ( bf>( <e\=1) c'> <e df'>) <e~ c'>^( <e bf'> ) | \stemDown <e' c'>8 <e df'> <e~ c'>^( <e bf'> ) <f\=1 -\shapeII #'((0 . -.7)(p 30 .4)(p 30 .4)(.2 . -.7)) ( bf>( <e\=1) c'> <e df'>) <e~ c'>^( <e bf'> ) } %%%%%%%%%%%%%%%%%%%%%%%%%%%

uliska commented 4 years ago

Well, I didn't change anythonv on that. But your original fild should now work without the error and give sn ingormative deprecation warning. -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

soundsfromsound commented 4 years ago

Apologies. Yes, I did clone that branch and test it out - the log looks much better now to my eyes. A new deprecation warning is very helpful.

On 10/17/2019 2:52 PM, Urs Liska wrote:

Well, I didn't change anythonv on that. But your original fild should now work without the error and give sn ingormative deprecation warning. -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openlilylib/snippets/issues/171?email_source=notifications&email_token=AA5OXFZ6X3IKQ3IGZYEEZTLQPCYATA5CNFSM4JBRNI3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBREYFQ#issuecomment-543312918, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5OXF4LORYCR5WC4ZVUVRDQPCYATANCNFSM4JBRNI3A.