Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to parse ly2video line #112

Open
miifanboy opened this issue Feb 3, 2023 · 6 comments
Open

Error: Failed to parse ly2video line #112

miifanboy opened this issue Feb 3, 2023 · 6 comments

Comments

@miifanboy
Copy link

I tried my own .ly files and even the ones in this repository in test directory and i still get this error:

ERROR: Failed to parse ly2video line:
ly2video: ( 8.6999940000000000, 10.6619960000000000) pitch -1:5:0 @ 0.0000000000000000 from C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/sanitised.ly: 19:5

I attached the files generated by ly2video and here is the input.ly file:

\version "2.16.0"

\header {
}

music = \new Voice {
  \relative c' {
    <a c e>1 q <f a c>2 q
  }
}

\score {
  \music
  \layout { }
  \midi { }
}

Lilypond: GNU LilyPond 2.24.0
TiMidity++ : 2.15.0-win32
FFMpeg: 4.3.1
Python: 3.9
Pillow: 9.4.0
pexpect: 4.8.0
python-midi: I used py-midi 2.0.1 instead because python-midi gave errors on installation

Console Output (There are some Turkish words in it but they don't represent any errors):

(ly2vid) C:\Users\sonfi>ly2video -d -i "C:\Users\sonfi\OneDrive\Belgeler\song2\input.ly" -o input.mp4
Running: lilypond -v

LilyPond was found.
FFmpeg was found.
TiMidity++ was found.
------------------------------------------------------------
Version in C:\Users\sonfi\OneDrive\Belgeler\song2\input.ly: 2.16.0
Will convert to: 2.24.0
The filename, directory name, or volume label syntax is incorrect.
WARNING: Convert of input file has failed. This could cause some problems.
new ly file is C:\Users\sonfi\AppData\Local\Temp\ly2video0d9o969f\unconverted.ly
------------------------------------------------------------
Generating PNG and MIDI files ...
------------------------------------------------------------
Running: lilypond --png -I 'C:\Users\sonfi' -dmidi-extension=midi -dresolution=110 -dpreview '-dprint-pages=#f' 'C:\Users\sonfi\AppData\Local\Temp\ly2video0d9o969f\unconverted.ly'

GNU LilyPond 2.24.0 (running Guile 2.2)
Processing `C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/unconverted.ly'
Ayr─▒┼şt─▒r─▒l─▒yor...
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:59:25: uyar─▒: deprecated: missing `.' in property path NoteHead.after-line-breaking
    \override NoteHead
                        #'after-line-breaking = #dump-spacetime-info
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:63:24: uyar─▒: deprecated: missing `.' in property path BarLine.after-line-breaking
    \override BarLine
                       #'after-line-breaking = #dump-spacetime-info-barline
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:67:25: uyar─▒: deprecated: missing `.' in property path ChordName.after-line-breaking
    \override ChordName
                        #'after-line-breaking = #dump-spacetime-info
Interpreting music...
Grafik nesneler ├Âni┼şleme tabi tutuluyor...
Interpreting music...
MIDI ├ğ─▒kt─▒s─▒ `unconverted.midi'ye...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `unconverted.preview.eps'...
Converting to PNG...
Success: compilation successfully completed
------------------------------------------------------------
Generated PNG and MIDI files
Looking for staff lines in unconverted.preview.png
First staff line found at (0, 14)
Found 5 staff lines
Margins in mm: left=46 top=83 right=46 bottom=83
Margins in px: left=200 top=360 right=200 bottom=360
Wrote sanitised version of C:\Users\sonfi\AppData\Local\Temp\ly2video0d9o969f\unconverted.ly into C:\Users\sonfi\AppData\Local\Temp\ly2video0d9o969f\sanitised.ly
Generating PNG and MIDI files ...
------------------------------------------------------------
Running: lilypond --png -I 'C:\Users\sonfi' -dmidi-extension=midi -dresolution=110 'C:\Users\sonfi\AppData\Local\Temp\ly2video0d9o969f\sanitised.ly'

GNU LilyPond 2.24.0 (running Guile 2.2)
Processing `C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/sanitised.ly'
Ayr─▒┼şt─▒r─▒l─▒yor...
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:59:25: uyar─▒: deprecated: missing `.' in property path NoteHead.after-line-breaking
    \override NoteHead
                        #'after-line-breaking = #dump-spacetime-info
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:63:24: uyar─▒: deprecated: missing `.' in property path BarLine.after-line-breaking
    \override BarLine
                       #'after-line-breaking = #dump-spacetime-info-barline
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:67:25: uyar─▒: deprecated: missing `.' in property path ChordName.after-line-breaking
    \override ChordName
                        #'after-line-breaking = #dump-spacetime-info
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:59:25: uyar─▒: deprecated: missing `.' in property path NoteHead.after-line-breaking
    \override NoteHead
                        #'after-line-breaking = #dump-spacetime-info
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:63:24: uyar─▒: deprecated: missing `.' in property path BarLine.after-line-breaking
    \override BarLine
                       #'after-line-breaking = #dump-spacetime-info-barline
C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/dump-spacetime-info.ly:67:25: uyar─▒: deprecated: missing `.' in property path ChordName.after-line-breaking
    \override ChordName
                        #'after-line-breaking = #dump-spacetime-info
Interpreting music...
Grafik nesneler ├Âni┼şleme tabi tutuluyor...
Interpreting music...
MIDI ├ğ─▒kt─▒s─▒ `sanitised.midi'ye...
Converting to PNG...
Success: compilation successfully completed
------------------------------------------------------------
Generated PNG and MIDI files
------------------------------------------------------------
ERROR: Failed to parse ly2video line:
ly2video: (     8.6999940000000000,     10.6619960000000000) pitch -1:5:0 @      0.0000000000000000 from C:/Users/sonfi/AppData/Local/Temp/ly2video0d9o969f/sanitised.ly: 19:5

Sorry, ly2video has encountered a fatal bug as described above,
which it could not attribute to any known cause :-(

Please consider searching:

    https://github.com/aspiers/ly2video/issues

and if the problem is not listed there, please file a new
entry so we can get it fixed.  Thanks!

Aborted execution.

ly2video0d9o969f.zip

@aspiers
Copy link
Owner

aspiers commented Feb 4, 2023

I suspect this is probably because ly2video doesn't expect the path to the .ly file to contain any : characters, but since you're on Windows, it begins with C:. This should be a simple fix - can you try changing the second line of these two in cli.py:

                     # file:line:char
                     '([^:]+): *(\d+):(\d+)'

to

                     # file:line:char
                     '(.+): *(\d+):(\d+)'

and then try again?

@miifanboy
Copy link
Author

miifanboy commented Feb 5, 2023

I tried it but it still gives me the same error with the same values

Edit:

The problem occurs on the line i marked with * so I think the problem is with the file regex:

\include "dump-spacetime-info.ly"
\include "dump-spacetime-info.ly"
\version "2.16.0"
\paper {
   page-breaking = #ly:one-line-breaking
   top-margin    = 83\mm
   bottom-margin = 83\mm
   left-margin   = 46\mm
   right-margin  = 46\mm
}
#(set-global-staff-size 20)

\header {
   tagline = ##f composer = ##f
}

music = \new Voice {
  \relative c' {
    <a c e>1 q <f a c>2 q            ************************************************************************
  }
}

\score {
 \unfoldRepeats
  \music
  \layout { }
  \midi { }
}

@aspiers
Copy link
Owner

aspiers commented Feb 5, 2023

Did you reinstall the updated code with pip install after editing it?

@miifanboy
Copy link
Author

Yes, I tried that it didn't work but then I removed '$' in

# file:line:char
'(.+): *(\d+):(\d+)'
'$', line)

so the final version would be:

# file:line:char
'(.+): *(\d+):(\d+)'
,line)

after that, Timidity++ gave errors so I had to port it to fluidsynth instead, now it can generate sound and video for normal notation but i am getting errors when i try to use guitar tableture instead. I can close this issue and create a seperate issue for that if you prefer keeping things clean.

ERROR: Didn't find any notes; something must have gone wrong with the use of dump-spacetime-info.

@aspiers
Copy link
Owner

aspiers commented Feb 6, 2023

If the final $ was causing problems then I suspect it could be a Windows CR/LF line-ending issue. Perhaps changing to \r?$ would work?

Let's keep this open until we figure out exactly what the parsing issue was. And yes please, let's have separate issues filed for each issue found - thanks!

aspiers added a commit that referenced this issue May 20, 2023
Issue #112 reported a failure of parsing of the temporary
sanitised.ly.out file on Windows due to semi-colons in file paths, and
also possibly CR LF line-endings.  So attempt to fix both these
problems.
@aspiers
Copy link
Owner

aspiers commented May 20, 2023

@miifanboy This may be fixed in master now; please can you test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants