Code Monkey home page Code Monkey logo

Comments (9)

jperon avatar jperon commented on August 15, 2024

Thank you for your report ; I'll have a glance at it from thursday.

from lyluatex.

rpspringuel avatar rpspringuel commented on August 15, 2024

Based on my examination of the code, it appears that the package is trying to make use of the --include option when invoking LilyPond. That is, it is supposed to --include the directory of the original source file, thereby adding it to the search path for input files. If that's the case, then I don't know why it's not working.

I have two ideas for an alternate implementation, one of which I'm fairly certain is viable, the other I have more questions about (and which I've sent an inquiry to the LilyPond user list to discover the necessary answers):

  1. My fairly certain option involves not copying the contents of source file into the file written to tmp_ly when adding the header, but using an \include statement instead. You'd also need to add #(ly:set-option 'relative-includes #t) to the top of the header file so that the LilyPond looks for included files relative to the file being currently read instead of the root file (which would be our dummy file in tmp_ly). In this case, since the source file is being read from its original location, all included files will be in the correct relative positions without needing to copy them into a new tree.

  2. The less certain option is to create a project init.ly file in tmp_ly to which the current header has been added as a footer. In this case invoking LilyPond with --init="lyluatex_init.ly" on the original source file would produce the appropriate files. This has the advantage of each project only needing to create one new source file: lyluatex_init.ly. This would, therefore, eliminate the need for lua to read the original file and md5 hash its contents (which is added to the filename of the file created in tmp_ly to prevent name conflicts) and thus give a performance boost (perhaps only noticeable if ly files are really big or there are a lot of them). Having never created a custom init.ly file before, I'm less certain this will work, but I've asked on the LilyPond user list for some more information to see if this is really possible.

from lyluatex.

jperon avatar jperon commented on August 15, 2024

Excuse me, I've just begun looking at that…
But when I go to the Scores dir, and launch lilypond OurFather.ly, I get the error below.
I've tried replacing all bflat by bf, and I don't get errors any more, neither with lilypond alone, nor with lualatex.

GNU LilyPond 2.19.47
Traitement de « OurFather.ly »
Analyse...
OurFather.ly:13:196: Erreur : syntax error, unexpected STRING
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g 
                                                                                                                                                                                                   bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g bflat> \bar "|" <g bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:196: Erreur : chaîne non reconnue ; en dehors d'un script textuel ou de \lyricmode
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g 
                                                                                                                                                                                                   bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g bflat> \bar "|" <g bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:216: Erreur : syntax error, unexpected STRING
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g 
                                                                                                                                                                                                                       bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g bflat> \bar "|" <g bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:216: Erreur : chaîne non reconnue ; en dehors d'un script textuel ou de \lyricmode
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g 
                                                                                                                                                                                                                       bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g bflat> \bar "|" <g bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:392: Erreur : syntax error, unexpected STRING
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g 
                                                                                                                                                                                                                                                                                                                                                                                                       bflat> <g bflat> \bar "|" <g bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:392: Erreur : chaîne non reconnue ; en dehors d'un script textuel ou de \lyricmode
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g 
                                                                                                                                                                                                                                                                                                                                                                                                       bflat> <g bflat> \bar "|" <g bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:402: Erreur : chaîne non reconnue ; en dehors d'un script textuel ou de \lyricmode
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g 
                                                                                                                                                                                                                                                                                                                                                                                                                 bflat> \bar "|" <g bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:421: Erreur : syntax error, unexpected STRING
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g bflat> \bar "|" <g 
                                                                                                                                                                                                                                                                                                                                                                                                                                    bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:421: Erreur : chaîne non reconnue ; en dehors d'un script textuel ou de \lyricmode
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g bflat> \bar "|" <g 
                                                                                                                                                                                                                                                                                                                                                                                                                                    bflat>2 <g bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:432: Erreur : syntax error, unexpected STRING
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g bflat> \bar "|" <g bflat>2 <g 
                                                                                                                                                                                                                                                                                                                                                                                                                                               bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:13:432: Erreur : chaîne non reconnue ; en dehors d'un script textuel ou de \lyricmode
	a2 g4 f g g \bar "|" g2 g4 f g a a \bar "||" <f a>2 <c g'>4 <d f> <c g'> <c g'> \bar "|" <c g'>2 <f a> \bar "|" <f a>4 <f a> <c g'> <d f> \bar "|" <d f>2 <c g'> \bar "|" <c g'>4 <f a> <g bflat>2 \bar "|" <g bflat> <c, g'>4 <f a>2 \bar "|" <f a>4 <f a> <f a> <c g'> <d f> <c g'> <c g'> <c g'> \bar "|" <c g'>2 <c g'>4 <f a> <f a> <c g'> <d f> <d f>^- \bar "|" <d f>2 <c g'>4 <f a> <g bflat> <g bflat> \bar "|" <g bflat>2 <g 
                                                                                                                                                                                                                                                                                                                                                                                                                                               bflat>4^- <c, g'>^- <f a> <f a>^- \bar "|."
OurFather.ly:5:1: Erreur : suite à des erreurs répétées, l'expression musicale sera ignorée

<<
erreur fatale : erreur sur les fichiers "OurFather.ly"

from lyluatex.

rpspringuel avatar rpspringuel commented on August 15, 2024

There's a syntax change in the english note names some time in the 2.19 cycle. flat and sharp became -flat and -sharp (the short form of the names f and s remained the same). The files need to be run through convert-ly to work with 2.19.53.

Here's what I get (including log files) after bringing them up to date and trying again (note, on my system lilypond refers to 2.18.2 while lilypond-def is 2.19.53):
Test_Lily_include .zip

from lyluatex.

jperon avatar jperon commented on August 15, 2024

I think the problem comes from the space at the end of the name of Test_Lily_include folder : if I remove it, then clean files within it, this works.

from lyluatex.

rpspringuel avatar rpspringuel commented on August 15, 2024

I hadn't noticed that spurious space but after removing it, and removing the space in the enclosing folder of that one on my system, everything worked fine.

So then the real problem is that the path to the include directory is not quoted, and thus can't have any spaces in it.

from lyluatex.

jperon avatar jperon commented on August 15, 2024

Should be fixed in 549af4d.

from lyluatex.

rpspringuel avatar rpspringuel commented on August 15, 2024

Works for me. Thanks for the fix.

from lyluatex.

jperon avatar jperon commented on August 15, 2024

from lyluatex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.