Hi Raphael,
Thanks for trying mscx2ly!
I looked at your musescore file and found that:
* it was created with an older version of musescore (3.6.2), which is
3 years old
* when opening your file with MuseScore 4.4.3, MuseScore complained
that the file was possibly corrupt, as it was missing a few beats in
3 bars.
As I indicated in my original message, the basis for mscx2ly is
savefiles created by MuseScore 4.4.3. That file format (version 4.40)
splits up the Score data in a few main lemmas:
* Order (to describe the order of the instruments)
* Parts (describing the parts and associated staffs)
* Staffs (describing the actual staffs and musical content)
It turns out that the file format of your example (3.02) does not
contain the Order lemma, and as a consequence mscx2ly chokes. That it
chokes is therefore expected. I completely agree with you though that it
should not crash, but handle that situation gracefully.
I have added better error handling, so from version 0.1.9 mscx2ly will:
* warn for older versions (everything < 4.x.x)
* give a clear error message in what part of the process it failed
* write a stacktrace to an error.log and display a request to report
the error and where to report it.
Thanks for your detailed report and the example file!
cheers
Maurits
Op 5-11-2024 om 18:16 schreef Raphael Mankin:
I had a mscx from I don't know where. Here is the result. The input is
from Musescore, and getting the output wrong is acceptable at this
stage. However, your program should not crash.
I look forward to improvements. Sorry, node.js is outside my skill set.
Attached
Options:$ mscx2ly score.mscx score.lyx
file:///usr/local/lib/node_modules/mscx2ly/lib.js:621
const orderInfo = readOrderInfo(MSCData.museScore.Score[0].Order[0]);
^
TypeError: Cannot read properties of undefined (reading '0')
at convertMSCX2LY
(file:///usr/local/lib/node_modules/mscx2ly/lib.js:621:69)
at mscx2ly
(file:///usr/local/lib/node_modules/mscx2ly/index.js:30:20)
Node.js v18.19.1
On 05/11/2024 16:39, Maurits Lamers via LilyPond user discussion wrote:
Hey all,
I happened to be in the need of converting a few pieces of music
written using MuseScore and create Lilypond notation. That
functionality seems to have been originally been included with
MuseScore but was removed already some time ago.
As there was nothing that I could find that would do what I wanted
(and I probably also didn't look very hard), it seemed to be easier
to simply write one.
This converter doesn't attempt to be a full converter. There are too
many differences, and as the README already states MuseScore needs
trickery with articulations to get a bit more musical sound. It can
at least save you having to manually copy a lot of notes. I wrote it
using files saved by MuseScore version 4.4.3, so your milage with
other versions might vary.
https://www.npmjs.com/package/mscx2ly
https://github.com/mauritslamers/mscx2ly
Please try it out and contribute if you want!
cheers
Maurits