musicxml2ly fails on <part-name-display> with multiple <display-text>

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

musicxml2ly fails on <part-name-display> with multiple <display-text>

Noam Postavsky
The attached example-musicxml-display-part-bug.xml shows a minimal
example to trigger the bug. It gives this output:

musicxml2ly: Reading MusicXML from example-musicxml-display-part-bug.xml ...
musicxml2ly: Converting to LilyPond expressions...
Traceback (most recent call last):
  File "/usr/bin/musicxml2ly", line 2986, in <module>
    main()
  File "/usr/bin/musicxml2ly", line 2981, in main
    voices = convert (filename, options)
  File "/usr/bin/musicxml2ly", line 2892, in convert
    score = extract_score_structure (mxl_pl, staff_info)
  File "/usr/bin/musicxml2ly", line 430, in extract_score_structure
    staff = read_score_part (el)
  File "/usr/bin/musicxml2ly", line 383, in read_score_part
    staff.instrument_name = extract_display_text (partname)
  File "/usr/bin/musicxml2ly", line 907, in extract_display_text
    child = el.get_maybe_exist_named_child ("display-text")
  File "/usr/share/lilypond/2.18.2/python/musicxml.py", line 114, in
get_maybe_exist_named_child
    return self.get_maybe_exist_typed_child (get_class (name))
  File "/usr/share/lilypond/2.18.2/python/musicxml.py", line 123, in
get_maybe_exist_typed_child
    raise "More than 1 child", klass
TypeError: exceptions must be old-style classes or derived from
BaseException, not str

The original case where I ran into this is
http://www1.cpdl.org/wiki/images/5/54/Ws-mont-bvf.mxl, which says

   <software>Sibelius 7.5.1</software>
   <software>Direct export, not from Dolet</software>
   <encoding-description>Sibelius / MusicXML 3.0</encoding-description>

I propose the attached musicxml2ly-multi-display-text.patch as a fix.

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

musicxml2ly-multi-display-text.patch (668 bytes) Download Attachment
example-musicxml-display-part-bug.xml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: musicxml2ly fails on <part-name-display> with multiple <display-text>

Noam Postavsky
On Thu, 5 Mar 2020 at 22:45, Noam Postavsky <[hidden email]> wrote:
>
> The attached example-musicxml-display-part-bug.xml shows a minimal
> example to trigger the bug. It gives this output:

> get_maybe_exist_typed_child
>     raise "More than 1 child", klass

> The original case where I ran into this is
> http://www1.cpdl.org/wiki/images/5/54/Ws-mont-bvf.mxl, which says
>
>    <software>Sibelius 7.5.1</software>
>    <software>Direct export, not from Dolet</software>
>    <encoding-description>Sibelius / MusicXML 3.0</encoding-description>

Ping?

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