bgr / mingus

Automatically exported from code.google.com/p/mingus
GNU General Public License v3.0
1 stars 1 forks source link

LilyPond failing on Windows #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

>>> to_png("c'", "\\temp\\out.png")
Executing: lilypond -fpng -o "\temp\out.png" "\temp\out.png.ly"
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python25\Lib\site-packages\mingus\extra\LilyPond.py", line 197,
in to_png
    return save_string_and_execute_LilyPond(ly_string, filename, "-fpng")
  File "C:\Python25\Lib\site-packages\mingus\extra\LilyPond.py", line 218,
in save_string_and_execute_LilyPond
    sts = os.waitpid(p.pid, 0)
OSError: [Errno 10] No child processes

What version of the product are you using? On what operating system?
0.4.2.3, Windows XP

Please provide any additional information below.

I have verified that LilyPond is installed and in the path; I can run
Lilypond from a command prompt without being in its directory.

Could this be related to having multiple CPUs?

Original issue reported on code.google.com by austinlu...@gmail.com on 9 Sep 2009 at 1:23

GoogleCodeExporter commented 9 years ago
I'm not quite sure why that is happening. It seems to fail on the waitpid 
syscall. 
Maybe the following works in LilyPond.py
Remove the line :

    sts = os.waitpid(p.pid, 0)

And replace:

    p = subprocess.Popen(command, shell=True)

with:

    p = subprocess.Popen(command, shell=True).wait()

Original comment by Rhijnauwen@gmail.com on 9 Sep 2009 at 8:33

GoogleCodeExporter commented 9 years ago
When I make those two changes, it does seem to run.

Though, this may be a separate issue, or a problem with my code, but it fails
silently and does not generate anything.

mingus.extra.LilyPond.to_png(from_Note(Note()), "\\temp\\out.png")

or

mingus.extra.LilyPond.to_png("c'", "\\temp\\out.png")

generate this out.png.ly:
\version "2.10.33"
c'

which fails with:

GNU LilyPond 2.12.2
Processing `out.png.ly'
Parsing...
out.png.ly:2:0: error: syntax error, unexpected NOTENAME_PITCH

c'error: failed files: "out.png.ly"

Original comment by austinlu...@gmail.com on 10 Sep 2009 at 11:13

GoogleCodeExporter commented 9 years ago
Yes, that seems to be a different issue. I'm currently not on a computer with
LilyPond installed, but I'll have a look later today / early tomorrow. 

I'll will also change the subprocess line in the code-base, since I found out 
waitpid
is a POSIX syscall and understandably doesn't work on Windows. 

Thanks for taking the time to report these issues. It's much appreciated. 

Original comment by Rhijnauwen@gmail.com on 10 Sep 2009 at 3:36

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r565.

Original comment by Rhijnauwen@gmail.com on 12 Sep 2009 at 7:44

GoogleCodeExporter commented 9 years ago
I just checked in the fix to your first problem and also made some changes to 
be able
to convert single Notes and NoteContainers. The problem was that when you want 
to use
these notes on their own, they have to be wrapped in parenthesis, like this: { 
c' }
or else LilyPond will complain with an unexpected NOTENAME_PITCH. 

In version 0.4.3.0 (which is not yet released, but already up in the 
repository) you
can use the 'standalone' argument to toggle the parenthesis. It is set to True 
by
default, so your example will work without change:
LilyPond.to_png(LilyPond.from_Note(Note("C")), "out.png")

Original comment by Rhijnauwen@gmail.com on 12 Sep 2009 at 7:50