issues with musicxml2ly

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

issues with musicxml2ly

Gilberto Agostinho-3
Hello bug-squad,

I ran into three issues when converting a .musicxml file generated with
MuseScore into LilyPond:


1) the .ly file outut by musicxml2ly seems to have a weird encoding and
outputs an error. There are many hidden characters which I had to remove
manually in order to compile the .ly file.


2) slur placement is not taken into account. The entry below has the
argument placement set to "below" but musicxml2ly outputs it as a
standard pair of ( ) instead of _( _)

<notations>
     <slur type="start" placement="below" number="1"/>
</notations>


3) MusicXML contains information about al niente hairpins but music2xml
does not use those. Perhaps this feature could be added? This is how the
.musicxml looks like:

<direction placement="below">
     <direction-type>
         <wedge type="diminuendo" number="1" default-y="-75.00"/>
     </direction-type>
</direction>

     [...music under which the hairpin is...]

<direction placement="below">
     <direction-type>
         <wedge type="stop" niente="yes" number="1" relative-x="16.00"/>
     </direction-type>
</direction>


Cheers,
Gilberto

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Gilberto Agostinho
Just a small follow up, I forgot to mention that I my musicxml2ly version is
2.19.82. I am also attaching a .musicxml file generated by MuseScore and the
.ly file generated by musicxml2ly. The .ly file does not compile and has the
hidden characters and strange enconding I mentioned.

test.musicxml
<http://lilypond.1069038.n5.nabble.com/file/t4165/test.musicxml>  
test.ly <http://lilypond.1069038.n5.nabble.com/file/t4165/test.ly>  

Opening this last file in a plain text editor and forcing the encoding as
UTF-8 allows us to spot several '\00' characters. Also notice that the
encoding of the .musicxml input file is indeed UTF-8 and those strings where
the '\00' character appears, such as encoding software and encoding date,
appear perfectly normal in the input file. Also, the '\00' characters also
appear in LilyPond specific commands, in this case in a line which should
contain '\context Staff = "2" <<'.

Let me know if I can help with anything else.

Cheers,
Gilberto



--
Sent from: http://lilypond.1069038.n5.nabble.com/Bugs-f58488.html

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Knut Petersen
Hi Gilberto!

> Let me know if I can help with anything else.

Which operating system do you use? 32-bit or 64-bit?

I suspect that you did not compile Lilypond yourself but used one of the installers. Am I right?

If I'm right: Don't use the python interpreter distributed with lilypond, use python 2.7.16.


Knut


_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Gilberto Agostinho-3
Hi Knut,

Thanks a lot for your reply. I use Linux Mint 18.3, 64-bit, and my
LilyPond is version 2.19.82. The default python interpreter in my
installation is 2.7.12, which I think is what came with my Linux Mint
18.3 (I believe I've never bothered trying to update it since I do all
my Python coding with Python 3). Do you think that these characters and
encoding problems might be caused by my Python 2 version? Do you know if
there has been any substantial differences between 2.7.12 and 2.7.16 in
terms of handling strings?

Cheers,
Gilberto



On 14/07/2019 08:18, Knut Petersen wrote:

> Hi Gilberto!
>
>> Let me know if I can help with anything else.
>
> Which operating system do you use? 32-bit or 64-bit?
>
> I suspect that you did not compile Lilypond yourself but used one of
> the installers. Am I right?
>
> If I'm right: Don't use the python interpreter distributed with
> lilypond, use python 2.7.16.
>
>
> Knut
>


_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Knut Petersen
Hi Gilberto!

>  I use Linux Mint 18.3, 64-bit, and my LilyPond is version 2.19.82. The default python interpreter in my installation is 2.7.12, which I think is what came with my Linux Mint 18.3 (I believe I've never bothered trying to update it since I do all my Python coding with Python 3). Do you think that
> these characters and encoding problems might be caused by my Python 2 version? Do you know if there has been any substantial differences between 2.7.12 and 2.7.16 in terms of handling strings?

You did not answer the question if you used one of the installers from lilypond.org or if you compiled lilypond.

Try if replacing

    musicxml ...

with

    python2 $(grep -o '"[^$^"]*$me"' `which musicxml2ly` | sed -e 's/"//g' -e 's/$me/musicxml2ly/')  ...

fixes your problem (I assume python2 executes your system's python 2.7.12). Please report the result.

Knut

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Gilberto Agostinho-3
Hi Knut,

> You did not answer the question if you used one of the installers from
> lilypond.org or if you compiled lilypond.
My apologies, forgot about that bit. I am not compiling myself, I am
using the installers from lilypond.org.

> Try if replacing
>
>     musicxml ...
>
> with
>
>     python2 $(grep -o '"[^$^"]*$me"' `which musicxml2ly` | sed -e
> 's/"//g' -e 's/$me/musicxml2ly/')  ...
Yes, that does seem to fix the issue! The .ly file created by
musicxml2ly does not have the encoding and strange character issues and
compiles normally.

Thanks for all the replies.

Cheers,
Gilberto

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Knut Petersen
Hi Gilberto!
>> Try if replacing
>>
>>     musicxml ...
>>
>> with
>>
>>     python2 $(grep -o '"[^$^"]*$me"' `which musicxml2ly` | sed -e 's/"//g' -e 's/$me/musicxml2ly/')  ...
> Yes, that does seem to fix the issue! The .ly file created by musicxml2ly does not have the encoding and strange character issues and compiles normally.

So edit your musicxml2ly wrapper script (the file given by 'which musicxml2ly'):

Delete lines 2, 3 and 4.
In the last line, replace

    exec "/.../python"

with

    python2


Bug 1:
Musicxml2ly is incompatible to the python2 distributed with the installers.
Musicxml2ly needs at least python2 2.7.0, lilypond installers provide python 2.4.5

Bug 2:
During building of lilypond with GUB musicxml2ly is used intensively.
Alas, musicxml2ly does not fail because erroneously not GUB's own python 2.4.5
but the system's python2 is used.

As none of the people involved in developing, testing and building the
lilypond distributions is using a python2 < 2.7.0, nobody realized that
there is a problem for a number of years.

Knut


_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Gilberto Agostinho-3
Hi Knut,

Thank you so much for your help and for the explanation, I really
appreciate it. This solves the main issue I was having.

Concerning the other two feature requests I made in my original in
relation to supporting slur positioning and al niente hairpins in
musicxml2ly (see
http://lilypond.1069038.n5.nabble.com/issues-with-musicxml2ly-td222401.html),
would it be possible to add those to the tracker, perhaps?

Many, many thanks,
Gilberto

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Michael Kesper
In reply to this post by Knut Petersen
Hi all,

On 14.07.19 22:59, Knut Petersen wrote:
> Bug 1:
> Musicxml2ly is incompatible to the python2 distributed with the installers.
> Musicxml2ly needs at least python2 2.7.0, lilypond installers provide python 2.4.5

This leads me to two questions:

a) What's the reason for shipping it's own python interpreter on linux?
b) Is there work on migrationg to Python3?
Python2 will be phased out by upstream really soon now.

Bye
Michael


_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond

signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Knut Petersen
On 15.07.19 09:34, Michael Kesper wrote:
> Hi all,
>
> On 14.07.19 22:59, Knut Petersen wrote:
>> Bug 1:
>> Musicxml2ly is incompatible to the python2 distributed with the installers.
>> Musicxml2ly needs at least python2 2.7.0, lilypond installers provide python 2.4.5
> This leads me to two questions:
>
> a) What's the reason for shipping it's own python interpreter on linux?
We want to provide easy to use installers that provide all the needed software for all the supported platforms.
Using the same python on all platforms might help to reduce effects of incompatibilities.
A relatively new reason: Python2 will be phased out by upstream really soon ;-)

> b) Is there work on migrationg to Python3?
I don't think so.

> Python2 will be phased out by upstream really soon now.

Yes. We know. No problem If we have our own python2 ;-)

Knut



_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Michael Kesper
Hi Knut,

On 15.07.19 15:44, Knut Petersen wrote:
> On 15.07.19 09:34, Michael Kesper wrote:
>> b) Is there work on migrationg to Python3?
> I don't think so.
>
>> Python2 will be phased out by upstream really soon now.
>
> Yes. We know. No problem If we have our own python2 ;-)

Sad to hear that.
If I find time I'll have a look into it.
Porting to Python3 is relatively doable in my experience.
And riding dead horses is not a good thing in my opinion.

Best wishes
Michael



_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond

signature.asc (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Karlin High
On 7/15/2019 8:59 AM, Michael Kesper wrote:
> If I find time I'll have a look into it.
> Porting to Python3 is relatively doable in my experience.

A few other people have expressed interest in working on Python
upgrades. Past discussions indicated that the biggest challenges would
be getting GUB to build Python for the Windows installer.

<https://lists.gnu.org/archive/html/lilypond-devel/2019-02/msg00099.html>

<https://lists.gnu.org/archive/html/lilypond-devel/2019-01/msg00082.html>

<https://lists.gnu.org/archive/html/lilypond-devel/2019-01/msg00064.html>

<https://lists.gnu.org/archive/html/lilypond-devel/2018-12/msg00042.html>

--
Karlin High
Missouri, USA

_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Knut Petersen
In reply to this post by Michael Kesper
Hi  Michael!
>>> b) Is there work on migrationg to Python3?
>> I don't think so.
>>
>>> Python2 will be phased out by upstream really soon now.
>> Yes. We know. No problem If we have our own python2 ;-)
> Sad to hear that.
> If I find time I'll have a look into it.
> Porting to Python3 is relatively doable in my experience.
> And riding dead horses is not a good thing in my opinion.
Porting lilypond to python 3 would also mean to teach GUB to cross-build
python 3 for all supported platforms. Actually, this would be the first step.

But feel free to contribute to Lilypond, we definitely need some more developers.

Knut



_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Paul Hodges
In reply to this post by Knut Petersen
Thanks very much for this!

I couldn't work out how your suggested changes can be applied in a
Windows installation, so instead I did the following:
(1) Installed Python 2.7.14 in the system (but without adding it to the
path);
(2) Used the following command (assuming default installation paths) in
a standard command window to run it in the directory containing
MyMusicFile.xml:

         C:\Python27\python.exe "C:\Program Files
(x86)\Lilypond\usr\bin\musicxml2ly.py" --nd --nrp --npl --nsd
--no-beaming --language=english MyMusicFile.xml"

This works perfectly for me, and is a significant improvement to
Lilypond for my usage!

Regards,
Paul Hodges

On 14/07/2019 21:59:41, "Knut Petersen" <[hidden email]>
wrote:

>Hi Gilberto!
>>>Try if replacing
>>>
>>>     musicxml ...
>>>
>>>with
>>>
>>>     python2 $(grep -o '"[^$^"]*$me"' `which musicxml2ly` | sed -e 's/"//g' -e 's/$me/musicxml2ly/')  ...
>>Yes, that does seem to fix the issue! The .ly file created by musicxml2ly does not have the encoding and strange character issues and compiles normally.
>
>So edit your musicxml2ly wrapper script (the file given by 'which musicxml2ly'):
>
>Delete lines 2, 3 and 4.
>In the last line, replace
>
>    exec "/.../python"
>
>with
>
>    python2
>
>
>Bug 1:
>Musicxml2ly is incompatible to the python2 distributed with the installers.
>Musicxml2ly needs at least python2 2.7.0, lilypond installers provide python 2.4.5
>
>Bug 2:
>During building of lilypond with GUB musicxml2ly is used intensively.
>Alas, musicxml2ly does not fail because erroneously not GUB's own python 2.4.5
>but the system's python2 is used.
>
>As none of the people involved in developing, testing and building the
>lilypond distributions is using a python2 < 2.7.0, nobody realized that
>there is a problem for a number of years.
>
>Knut
>
>
>_______________________________________________
>bug-lilypond mailing list
>[hidden email]
>https://lists.gnu.org/mailman/listinfo/bug-lilypond
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Paul Hodges
Oops!  Omit the quote mark in the middle of my statement after .py.

Paul

On 22/09/2019 11:57:06, "Paul Hodges" <[hidden email]> wrote:

>Thanks very much for this!
>
>I couldn't work out how your suggested changes can be applied in a
>Windows installation, so instead I did the following:
>(1) Installed Python 2.7.14 in the system (but without adding it to the
>path);
>(2) Used the following command (assuming default installation paths) in
>a standard command window to run it in the directory containing
>MyMusicFile.xml:
>
>         C:\Python27\python.exe "C:\Program Files
>(x86)\Lilypond\usr\bin\musicxml2ly.py" --nd --nrp --npl --nsd
>--no-beaming --language=english MyMusicFile.xml"
>
>This works perfectly for me, and is a significant improvement to
>Lilypond for my usage!
>
>Regards,
>Paul Hodges
>
>On 14/07/2019 21:59:41, "Knut Petersen" <[hidden email]>
>wrote:
>
>>Hi Gilberto!
>>>>Try if replacing
>>>>
>>>>     musicxml ...
>>>>
>>>>with
>>>>
>>>>     python2 $(grep -o '"[^$^"]*$me"' `which musicxml2ly` | sed -e 's/"//g' -e 's/$me/musicxml2ly/')  ...
>>>Yes, that does seem to fix the issue! The .ly file created by musicxml2ly does not have the encoding and strange character issues and compiles normally.
>>
>>So edit your musicxml2ly wrapper script (the file given by 'which musicxml2ly'):
>>
>>Delete lines 2, 3 and 4.
>>In the last line, replace
>>
>>    exec "/.../python"
>>
>>with
>>
>>    python2
>>
>>
>>Bug 1:
>>Musicxml2ly is incompatible to the python2 distributed with the installers.
>>Musicxml2ly needs at least python2 2.7.0, lilypond installers provide python 2.4.5
>>
>>Bug 2:
>>During building of lilypond with GUB musicxml2ly is used intensively.
>>Alas, musicxml2ly does not fail because erroneously not GUB's own python 2.4.5
>>but the system's python2 is used.
>>
>>As none of the people involved in developing, testing and building the
>>lilypond distributions is using a python2 < 2.7.0, nobody realized that
>>there is a problem for a number of years.
>>
>>Knut
>>
>>
>>_______________________________________________
>>bug-lilypond mailing list
>>[hidden email]
>>https://lists.gnu.org/mailman/listinfo/bug-lilypond
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: issues with musicxml2ly

Paul Hodges
Double Oops!!  The first quote mark is the correct one - omit the one at
the end (though in fact Windows tolerates it, which is how it got in
there unnoticed).

Paul

On 22/09/2019 15:50:55, "Paul Hodges" <[hidden email]> wrote:

>Oops!  Omit the quote mark in the middle of my statement after .py.
>
>Paul
>
>On 22/09/2019 11:57:06, "Paul Hodges" <[hidden email]> wrote:
>
>>Thanks very much for this!
>>
>>I couldn't work out how your suggested changes can be applied in a
>>Windows installation, so instead I did the following:
>>(1) Installed Python 2.7.14 in the system (but without adding it to
>>the path);
>>(2) Used the following command (assuming default installation paths)
>>in a standard command window to run it in the directory containing
>>MyMusicFile.xml:
>>
>>         C:\Python27\python.exe "C:\Program Files
>>(x86)\Lilypond\usr\bin\musicxml2ly.py" --nd --nrp --npl --nsd
>>--no-beaming --language=english MyMusicFile.xml"
>>
>>This works perfectly for me, and is a significant improvement to
>>Lilypond for my usage!
>>
>>Regards,
>>Paul Hodges
>>
>>
_______________________________________________
bug-lilypond mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-lilypond