< Back to IRCAM Forum

Fix ties of xml files that OM exported

Hello,
I ordered to ChatGPT a lispfunctino that fixes ties of musicxml that OM exported.
Put the attached text to a lispfunction, connecting a file-chooser (once mode) to the input 0 (the list) and an outfile (blocked) to the input 1 (right).

Now I am ordering to ChatGPT a lispfunction to export 8 tone microtone to Sibelius. The Sibelius plug-in which is also made by ChatGPT receives musicxml from OpenMusic, then add up/down symbols automatically.
Now it has still many bugs. I will report it soon.
fixtiesxml.lisp.txt (10.6 KB)

This is the report that ChatCPT created:

Hello,

I would like to report a possible issue in the MusicXML export from OpenMusic 7.7.

I exported a score from the OpenMusic score window using:

File -> Export -> MusicXML

The exported MusicXML seems to preserve the pitch information correctly, including eighth-tone values in <alter>, such as:

<alter>0.25</alter><alter>0.75</alter><alter>1.25</alter><alter>1.75</alter>

So the microtonal pitch information itself seems to be present in the XML.

However, I found an inconsistency in the tie information.

In the exported MusicXML, the logical tie elements:

<tie type="start"/><tie type="stop"/>

appear to be correctly present and balanced. But in some parts, the corresponding notation tie elements:

<notations>  <tied type="start"/></notations>

and

<notations>  <tied type="stop"/></notations>

are missing in many notes.

For example, in one exported file, I counted the following:

Part 1: tie_start=39, tie_stop=39, tied_start=39, tied_stop=39Part 2: tie_start=76, tie_stop=76, tied_start=65, tied_stop=51Part 3: tie_start=26, tie_stop=26, tied_start=26, tied_stop=26Part 4: tie_start=54, tie_stop=54, tied_start=40, tied_stop=41Part 5: tie_start=48, tie_stop=48, tied_start=38, tied_stop=44Part 6: tie_start=72, tie_stop=72, tied_start=45, tied_stop=52Part 7: tie_start=7,  tie_stop=7,  tied_start=7,  tied_stop=7

As shown above, the <tie> elements are balanced in every part, but the <tied> elements are missing in Parts 2, 4, 5, and 6.

When this MusicXML file is imported into Sibelius, the displayed ties are incorrect.
However, if I post-process the MusicXML by adding the missing <tied> elements according to the existing <tie> elements, the same file imports into Sibelius with the ties displayed correctly, matching the OpenMusic score window.

The post-processing did not change the notes or the logical <tie> elements. It only added missing <tied> elements inside <notations>.

Before correction:

<tie type="start"/> / <tie type="stop"/> : 322 starts, 322 stops<tied type="start"/> / <tied type="stop"/> : 260 starts, 260 stops

After correction:

<tie type="start"/> / <tie type="stop"/> : 322 starts, 322 stops<tied type="start"/> / <tied type="stop"/> : 322 starts, 322 stops

This suggests that the score displayed in OpenMusic, and the logical tie information exported as <tie>, are probably correct, but some notation tie information is lost during MusicXML export.

The issue seems to occur especially in parts with more complex rhythms, tuplets, and tied note subdivisions. Simpler parts in the same file exported correctly.

Would it be possible to check whether the MusicXML exporter sometimes omits <tied> elements inside <notations>, even when the corresponding <tie> elements are present?

I can provide the original MusicXML file and the corrected MusicXML file if useful.

Best regards,

Takuya Imahori

Dear Takuya,

First of all thank you for reporting issues. But PLEASE don not let chatgpt interfere here. ChatGpt is not GOD. It makes a lot of mistakes, and is not reliable.

So, first of all, can you tell me where the tie problem is in the OMexport? and if possible provide a simple example where the tie is problematic. I might find the problem.

Thank you.

Best
K

Dear Karim,
oh sorry :frowning:
Ok, I put some screenshots.
At first, this is the score window of OM that the ties are correct as I wanted.
I saved a xml file, using from the score window, file → export → musicxml
Then, Sibelius import this xml. But where multiplet with big number as 12 or 24, ties are not correct.
I used that above lispfunction (created by ChatGPT) which fixes

<tie type="start"/><tie type="stop"/>

with

<notations>  <tied type="start"/></notations>

and

<notations>  <tied type="stop"/></notations>

after that, it makes a new musicxml. Then imported again this new xml from Sibelius. The third screenshot, all ties are correctly read.


Can you send me the poly object in order to see whats wrong?
just the two first measures will suffice.

BEst
K

Ok no need to send. I located the problem.
Will try to fix it in a human way :slight_smile:
Best
K