Hi!
I looked at your file. The latest dev version of mscx2ly (v0.1.9) does
generate something (included as attachment), but it clearly does not do
multiple voices correctly. Thanks for the example!
cheers
Maurits
Op 6-11-2024 om 23:17 schreef Jakob Pedersen:
Hello Maurits,
Thank you for making this utility!
I tried with a 4.4.3 file and ran into this error:
file:///usr/lib/node_modules/mscx2ly/lib.js:397
const instruments = order.get('instrument').map((instrument) => {
^
TypeError: Cannot read properties of null (reading 'get')
at readOrderInfo (file:///usr/lib/node_modules/mscx2ly/lib.js:397:31)
at convertMSCX2LY (file:///usr/lib/node_modules/mscx2ly/lib.js:734:23)
at mscx2ly (file:///usr/lib/node_modules/mscx2ly/index.js:44:20)
Node.js v23.1.0
File attached.
Best wishes,
Jakob
On 05.11.2024 17.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
\version "2.24.0"
pianoOne = {
\key f \major \time 4/4 c''2,a'2 |
c''4 c''4 d''4 c''4,a'4 f'4 f'4 f'4 |
c''2 a'2,e'2 d'2 |
bes'2 a'4 g'4,d'2 c'4 c'4 |
g'4 f'2 e'4,d'4. a8 c'2 |
f'2,c'2 |
r4 a'4,r4 f'4 |
g'4 e'4 f'4 d'4,d'4 c'4 c'4 b!4 |
c'2 r4 c''4,c'8 d'8 e'4 r4 e'4 |
c''4 c''4 d''4 c''4,g'4 f'4 f'4 f'4 |
c''2 a'2,e'2 d'2 |
bes'2 a'4 g'4,d'2 f'4 d'4 |
g'4 f'2 e'4,e'4 f'4 g'4 c'4 |
f'2,c'2 \bar "|."
}
pianoTwo = {
\key f \major \time 4/4 c'2,f2 |
c'4 a4 bes4 a4,f4 f4 bes4 f4 |
g2 f2,c2 d2 |
f2 a4 c'4,bes,2 f4 e4 |
bes4 a2 g4,d2 c2 |
a2,f,2 |
r4 c'4,r4 f4 |
bes4 a4 a4 g4,g4 a4 f4 g4 |
g2 r4 g4,c2 r4 c4 |
g4 a4 bes4 a4,e4 f4 bes,4 f4 |
g2 fis!2,c2 d2 |
g2 c'4 bes4,g,2 a,4 bes,4 |
a2 g2,c2 c2 |
a2,f,2 \bar "|."
}
\book {
\header {
title = "En rose så jeg skyde"
composer = "arr, Michael Praetorius (1609)"
}
\score { <<
\new PianoStaff <<
\set PianoStaff.instrumentName = "Piano"
\set PianoStaff.shortInstrumentName = "Pno."
\new Staff {
\clef treble
\pianoOne
}
\new Staff {
\clef bass
\pianoTwo
}
>>
>>
}
}
\book {
\bookOutputSuffix "Piano"
\header {
title = "En rose så jeg skyde"
composer = "arr, Michael Praetorius (1609)"
instrument = "Piano"
}
\score {
\new PianoStaff <<
\set PianoStaff.instrumentName = "Piano"
\set PianoStaff.shortInstrumentName = "Pno."
\new Staff {
\clef treble
\pianoOne
}
\new Staff {
\clef bass
\pianoTwo
}
>>
}
}