Skip to main content
Topic: MUSICXML TO NOTEWORTHY CONVERTER (Read 1143 times) previous topic - next topic

MUSICXML TO NOTEWORTHY CONVERTER

This tool convert musicxml files to nwctxt files

- The input file must be a score-partwise musicxml file.
- The output file is a nwctxt file.
- Different voices are placed on different (layered) staves.
- For some features that aren't supported in NWC itself, a 'user object' is used. You may see a popup that alerts you to download
a missing plugin.

- Known issues:
  - Features that aren't supported in NWC and for which no user object exists or for which I can't determine the correct parameters,
  will give erroneous results, e.g. tuples other than triples, cross-staff beams and slurs.
  - Because of the layering, some notes, their accidentals or dots may overlap with each other. This can be fixed by setting
  the properties 'Extra Accidental Spacing', 'Extra Note Spacing' and/or 'Extra Dot Spacing'.
  - If you encounter other issues, please let me know.

This is a stand alone Windows program, not a classic nwc user tool, so you can't invoke it from within NWC.
You can download a Windows installer program in  https://www.opagust.be/?q=content/mxml2nwc.


-Versions:
- 15/09/2021: 1.0: Original version
- 02/11/2021: 1.0.1: bug fixes

INSTALLATION:
    Download and run the installation file.
    During installation, the target folder is shown and can be modified.
    After installation, a shortcut 'MXML2NWC' will be created on your desktop.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #1
I'm getting this error when I try to run it.

(It took me a while to find the program. It would be nice if it gave the option of creating a shortcut on my desktop :) )

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #2
I'm getting this error when I try to run it.

(It took me a while to find the program. It would be nice if it gave the option of creating a shortcut on my desktop :) )

I'm looking into it.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #3
I'm getting this error when I try to run it.

(It took me a while to find the program. It would be nice if it gave the option of creating a shortcut on my desktop :) )

Hi Mike,

1) About the error:

One of the first things the tool does is looking into the Windows registry to find the folder for the object plugins (wich you can see in NWC via 'Tools/Options', tab 'Folders').
I'm searching with register key ' \HKEY_CURRENT_USER\SOFTWARE\NoteWorthy Software\NoteWorthy Composer 2\Folders' for an entry 'UserPlugins'. That always worked on my (Windows 10) computer. I don't know why it doesn't work on yours, but the error can easily be intercepted.

When the tool inserts an user object and the corresponding plugin is not found in the plugin folder, a popup is shown, saying "You need to download following object plugin: ...".
But the purpose is only to inform the user of a missing plugin, the user object itself will be present in the output file anyway.
So now I've changed the program to intercept that error and go on.
In that case you can get popups 'You need to download...' for one or more user objects, even if you already downloaded it.

2)About  finding the program:
During installation the target folder is shown and can be modified as well. But it can be easily overlooked, so I will explicitly state that.

3) About a desktop shortcut:
I've changed the installation procedure: a desktop shortcut 'MXMX2NWC' will be created. Unfortunately I couldn't find out how to include it as an option,so it will always be created.

Go to  https://www.opagust.be/?q=content/mxml2nwc to download a new Windows installer for the new version of the program.

I'm looking forward for your feedback.

Gust
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #4
Thanks for the response. First, I will let you know that I got the tool to run, and I will be testing it on several MusicXML files shortly.  Next, I'll let you know what I discovered about the error.

When I examined the registry path you gave, it was empty on my system (that is, it contained only (Default) with (value not set).  I ran NWC and went to Tools > Options... > Folders and there was an entry for Object Plugins, which listed ":programdata:\Noteworthy Software\nwc2\UserPlugins". Just for fun, I highlighted this entry and clicked Modify... and then clicked OK without changing anything. I then reran RegEdit32 and lo and behold, there was now a string named UserPlugins in that key, with the expected value.  So it appears that NWC will create the string once you modify a folder value from its default. (I should mention that I recently had to reinstall Windows 10, and hence NWC, so my system was in a "clean slate" mode.)  I would suggest that if you don't find a UserPlugins string in the registry, that you could assume the default user plugin location that NWC uses.

Thanks again for the quick turnaround.

Mike

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #5
I would suggest that if you don't find a UserPlugins string in the registry, that you could assume the default user plugin location that NWC uses.

I note that suggestion, but I'll wait a little longer to implement it until I get the results of your further testing.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #6
I tried to convert a file from Capella 7 to MusicXml and then to NWC. Unfortunately, there's some hiccup - is this the right place to ask? I have added the XML file (as a zip) as well as the error I encounter ...

H.M.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #7
I tried to convert a file from Capella 7 to MusicXml and then to NWC. Unfortunately, there's some hiccup - is this the right place to ask? I have added the XML file (as a zip) as well as the error I encounter ...

H.M.
This is the right place to ask.
I'll look into it.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #8
Found and corrected the error (Decimal number were I supposed an integer).

The new version (1.0.1) is available on https://www.opagust.be/?q=content/mxml2nwc
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #9
First of all, thanks! - and wow!!! - this is and will be really, really helpful for me: In Germany, laymen's scores are mostly written in Capella. Being able to get them into NWC is great (even though there's some work to be done afterwards to clean up, of course - depending on the quality I want to get).

There's one thing that I would think about: The installer is not signed, and so it complains about an "unknown publisher". I feel that I would not recommend this program to anyone with the advice "just click on advanced and install anyway" (even though I did this, of course). A "right" solution is of course to purchase a code-signing certificate (quick googling found $83/year, less if purchased over 3 years, at https://cheapsslsecurity.com); but I've never done this, and the process (identity verification) might be a hassle? Publishing the Python script and a starter .cmd/-bat file, with additional instructions on how to install Python might be another, and simpler, way to go ...

Last, the 1.0 version is now quite useless on the website, isn't it?

H.M.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #10
  • Thanks for your positive respons.
    Because I never found a unambiguous syntax description for MXML files, I had to develop this tool with trial and error, testing with files from different sources.
    I did not know about XML files generated by Capella before, so I'm glad it worked out so well.
  • As to the 'unknown publisher' fact: My website has no commercial intention. The majority of the downloads are NWC related, and I suppose the NWC users 'know' me enough from the forum. The other downloads are intented for my personal friends and family (but  not exclusively of course).  So if someone cancels the install process because I'm unkwown, so be it.
  • Removing the 1.0 version before I got a positive respons seemed a little premature.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER - the next experiment

Reply #11
Granted, everything  :))

A much more brutal experiment: I found an open source OMR ("optical music recognition") program called Audiveris on GitHub. I took a somewhat complicated score - it is a modified version of John Rutter's "Dormi Jesu", which we currently rehearse in our choir, which I have written with NWC (we had to change a few things, because of SSAB, and because ... well ...) ---> see attachment "20210922-ch+p.Rutter_DormiJesu.pdf".

Audiveris creates .omr files. In this case, the resulting OMR file has about 1,5 MB (also when zipped - seems to be some image file format), so I couldn't append it here.

Audiveris can export to MusicXML, so this is what I did. The result is a .mxl file, which is a zipped XML file ---> see attachment "20210922-ch+p.Rutter_DormiJesu.mxl.zip" - I zipped the MXL, because the forum does not accept .mxl files. Opening the .mxl with MXML2NWC does not work - it seems that it does not see that this is a zipped file which needs unzipping (and yes, MXML2NWC does not accept .mxl as a standard extension for files it wants to open, so this is an "advertised feature"). Still, I have the (small) feature request that .mxl files are accepted, i.e. unzipped and then worked on the XML.

Manual unzipping of the .mxl yielded an XML file, which MXML2NWC actually digested, with a host of messages which I ignored (and did not read; and maybe would not have understood). Still, it created an NWCTXT file which is actually "usable" in the sense that one can extract substantial parts from it in NWC (which is the whole idea of OMR).

I also opened the .mxl file coming out of Audiveris in Musescore. Musescore complained that this was not a valid MusicXML file, but after pressing "Ignore" it also gobbled it up and created a score, which I again exported as MusicXML ---> see "20210922-ch+p.Rutter_DormiJesu_ReexportedFromMusescore.mxl.zip. Once more, I had to manually unpack the .mxl. Now, when I gave this to MXML2NWC, it ran into some Pythonian error.

I daresay I would be interested that this process works - even if with problems and lost information and whatever ... it might help me to create more musical renderings from scores lying around. Is there any possibility to improve, a little, on the problems above?

H.M.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #12
Accepting (unzipped) .mxl files will be a piece of (apple) cake.

I will soon download, unzip and run your files to see what messages and error they will generate.
And hopefully I will be able to explain the messages and correct the error.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #13
The new version (1.0.2) is available on https://www.opagust.be/?q=content/mxml2nwc

Quote
I zipped the MXL, because the forum does not accept .mxl files. Opening the .mxl with MXML2NWC does not work - it seems that it does not see that this is a zipped file which needs unzipping (and yes, MXML2NWC does not accept .mxl as a standard extension for files it wants to open, so this is an "advertised feature"). Still, I have the (small) feature request that .mxl files are accepted, i.e. unzipped and then worked on the XML.
A zipped *.mxl file is now accepted as input. An unzipped *.xml file will be generated and processed. The *.xml file will be saved  in the same directory as the input file.

Quote
Manual unzipping of the .mxl yielded an XML file, which MXML2NWC actually digested, with a host of messages which I ignored (and did not read; and maybe would not have understood).
When I unzipped your first file and used it as input for MXML2NWC, I had 2 popups with an error message 'Invalid Chord Error' with techincal information, that I happened to understand. Twice it concerned a generated nwctxt line that was not a legal NWCTXT object.
With the information in the popups I could find the cause in the input file: in 2 places a chord with two identical chord elements.
In this new version I replaced the error popups with information (see attachment) wich is hopefully more readable. It contains the staff name and measure number, the erroneous nwctxt line and the one that was generated instead.

Quote
I also opened the .mxl file coming out of Audiveris in Musescore. Musescore complained that this was not a valid MusicXML file, but after pressing "Ignore" it also gobbled it up and created a score, which I again exported as MusicXML ---> see "20210922-ch+p.Rutter_DormiJesu_ReexportedFromMusescore.mxl.zip. Once more, I had to manually unpack the .mxl. Now, when I gave this to MXML2NWC, it ran into some Pythonian error.
The Pythonian error when using your second, Musescore, file,- was again due to the presence of a decimal number where my program expected an integer. I fixed that and also a few other places where I thought a decimal number could be admitted. After running this new MXML2NWC version on your 2nd file, I got the same 2 popups as for your 1st file, so my conclusion is that the reason is due to the output of Audiveris.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #14
Thank you! - and onwards, to new enterprises:

a) I just scanned a modern transcription of a four-movement symphony of the obscure German composer Otto Carl Erdmann Duke of Kospoth (1753-1817). His great-great-great-nephew or something lives in our town, and for a birthday of the old gentleman I'll play a piano reduction I wrote ... but I'd also like to have the symphony played with some nice soundfonts (I'll try Sonatina Orchestra), and for this, I need the whole score. Instead of writing it, I'll try Audiveris + MXML2NWC! I'll write a separate reply for this.

b) In the attachment are (in a single .zip) two more .mxl files produced by Audiveris. The input for this was a scan of Ruth Elaine Schram's arrangement of "Go, Tell It On The Mountain" (see http://www.hmmueller.de/Scans/RuthSchram_GoTellItOnTheMountain.pdf - "permanently out of print", according to the publisher). I'd like to create a rehearsal voice/mp3 for a soloist singer from this via NWC. Audiveris produces two "movements", where the latter is the separate coda starting on the last page but one. Giving the first file to MXML2NWC 1.0.2 unfortunately creates another Python stacktrace ... Maybe you could look into this.

H.M.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #15
Kospoth's symphony worked nicely* for the 1st, 2nd and 3rd movement. The mxls produced by Audiveris already have a fair share of problems (however, some are from untypical notations in the score), but the result is quite usable. However, the 4th movement stumps MXML2NWC 1.0.2 (I hope - I just installed it over the previous one; does the installer replace it? ... it would be nice if there were a version info somewhere), with another Python error. The zipped .mxls are in the attachment (however, due to renaming, the XMLs stored inside the mxls do have strange names from my scanning operation - I hope this is fine).

* However, there are a few things where I stumble
a) The first staff of each NWCTXT contains "a million" PgTxts at  the start (see NWCTXT result of second movement in the attachment).
b) When opening, the files require a font "Default" which I apparently don't have.
c) Opening another .mxl file often (always?) crashes MXML2NWC later. You can try it with the symphony: First, convert and save movement 1; then, press "SELECT ..." again and open movement 3. "CONVERT" will result in an error - see attachment.

H.M.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #16
b) In the attachment are (in a single .zip) two more .mxl files produced by Audiveris. The input for this was a scan of Ruth Elaine Schram's arrangement of "Go, Tell It On The Mountain" (see http://www.hmmueller.de/Scans/RuthSchram_GoTellItOnTheMountain.pdf - "permanently out of print", according to the publisher). I'd like to create a rehearsal voice/mp3 for a soloist singer from this via NWC. Audiveris produces two "movements", where the latter is the separate coda starting on the last page but one. Giving the first file to MXML2NWC 1.0.2 unfortunately creates another Python stacktrace ... Maybe you could look into this.

H.M.

The Python stacktrace was due to the fact that Audiveris interpreted a chord symbol as a lyric syllable in lyric line 3 on a staff without  lyric lines 1 nor 2.
So in the next version of MXML2NWC  (coming soon, I hope), I will ignore lyrics assigned to lyric lines that  are 'out of order'.

P.S. I managed to download and install Audiveris. I used your pdf as input and I saw a lot of pink areas after transcription. I think these are the places where Audiveris had some difficulties to correctly 'read' the score and as a consequence may lead to incorrect areas  in the resulting NWCTXT file after running MXML2NWC.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #17
Kospoth's symphony worked nicely* for the 1st, 2nd and 3rd movement. The mxls produced by Audiveris already have a fair share of problems (however, some are from untypical notations in the score), but the result is quite usable. However, the 4th movement stumps MXML2NWC 1.0.2 (I hope - I just installed it over the previous one; does the installer replace it? ... it would be nice if there were a version info somewhere), with another Python error. The zipped .mxls are in the attachment (however, due to renaming, the XMLs stored inside the mxls do have strange names from my scanning operation - I hope this is fine).

* However, there are a few things where I stumble
a) The first staff of each NWCTXT contains "a million" PgTxts at  the start (see NWCTXT result of second movement in the attachment).
b) When opening, the files require a font "Default" which I apparently don't have.
c) Opening another .mxl file often (always?) crashes MXML2NWC later. You can try it with the symphony: First, convert and save movement 1; then, press "SELECT ..." again and open movement 3. "CONVERT" will result in an error - see attachment.

H.M.

The new version (1.0.3) is available on https://www.opagust.be/?q=content/mxml2nwc

  • Yes, the installer replaces the previous one.
    The window title bar now shows the version number.
  • I fixed the errors. The first one (list index out of scope) was a real bug. The second one was a beam property 'backward hook' that NWC can't digest. Unknown beam properties will now be ignored.
  • The "million" PgTxts are derived from the <credit-words> tags in the xml file. Audiveris seems to create these tags for everything that it can't recognize as musical symbol? Example:
     "<credit-words default-x="1686" default-y="11" font-family="sans-serif" font-size="198" font-weight="bold">—-—wv—~'—-</credit-words>"
  • The font 'Default' is derived from the tag "<lyric-font font-family="Default" font-size="10"></lyric-font>". I now replace it with 'Times New Roman'.
  • Opening an converting more than one file in the same run can cause some problems. Probable cause is that some variables are not properly restored. I found it to much effort to spit this out, so now I keep the select button disabled after opening a file. So you'll have to exit and restart the program, which seems to me not a big effort to ask for.
  • Your fourth movement prodced a lot of popups for invalid chords (caused by identical chord members in one chord object). So I replaced the multiple popups by showing these warnings in one extra window, tat doesn't halt the execution.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #18
Great - all items fine (especially, reopening the converter for more files is really no problem).

So, I now try to use the results to create a useful score. My initial experience with the "Go, tell it" score is: Not a nice job. The voices are not separated as one would hope - sometimes two-voice chords in a staff, but a few notes spill into another staff; long slurs and cresc/decresc, with many haphazard texts in between; and at times there are missing notes or dots, leading to too short measures.

It might be that a more useful process is actually: Remove everything except notes and rests (probably with a user tool), create a correct "naked score" from these; and finally add all the "small things" (and not so small ones) - either manually or, at a few places, by copying something over from the "ORM-ed" score.

The whole enterprise is certainly not for the faint-hearted, at least with this Audiveris+Converter pipeline; where the main "problem", but also "heavy-weight-lifter" is Audiveris: What it can and cannot do essentially defines the result. So be it. I'll see what I learn ...

H.M.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #19
It might be that a more useful process is actually: Remove everything except notes and rests (probably with a user tool), create a correct "naked score" from these; and finally add all the "small things" (and not so small ones) - either manually or, at a few places, by copying something over from the "ORM-ed" score.

The whole enterprise is certainly not for the faint-hearted, at least with this Audiveris+Converter pipeline; where the main "problem", but also "heavy-weight-lifter" is Audiveris: What it can and cannot do essentially defines the result. So be it. I'll see what I learn ...

Indeed, I agree that the output of Audiveris is the main problem here.
Maybe I can add a window to MXML2NWC where you can select/deselect the item types to convert ?

As for the sometimes missed notes or dots: In audiveris the measures that are too short after the transcription are colored pink, so that should be a help to locate them quickly in the nwctxt file.
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #20
Just a short "still working on it" message: I'm right now converting scans of modern prints of the 4 movements of a Kospoth symphony (2 oboes, 2 horns, strings) to NWC.

My process will require two passes through the NWC score: The first one makes all the notes and measure lengths correct - i.e., all notes are where they belong; the second is the fine-tuning process. I'm right now in the first pass, where I learn that Audiveris sometimes ignores (or despairs on) complete pages; first, I rewrote such missing segments manually - but now, I let Audiveris do another scan of that single pages - it comes out roughly right, so that after running it through MXML2NWC, I can paste in the respective segments (what is sorely missing for this from NWC, is vertical - mutli-staff - marking and copy/paste).

Right now I work with a single screen, but this is somewhat tedious. Tomorrow, I'll try two screens - one for the source PDF, the other for NWC.

Re selecting/deselecting item types, right now "Global Modification (adp)" with DELETE is sufficient; at one point I also did a F3-Del-Sequence. What might be helpful, is a switch to remove the "System Break" marks from bar lines - the NWC score will definitely be laid out differently.

H.M.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #21
Hi, Heinrich.
Just a short "still working on it" message on my behalf:
I'm working on version 1.1 of MWML2NWC, in which the conversion is done in 3 phases: analyse, setup and convert.
In the setup phase a window with 2 tabs is shown, that enables the user to setup the Title Page layout and the staff properties, see attachments.
I will add a checkbox for system and page breaks.
Any further suggestions from your side are very welcome.

I also added a 'Loggings' and 'Warnings' frame that are filled during the conversion, see third attachment.

Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #22
All this looks good. One more thing would be nice: A checkbox that suppresses custom note velocities on dynamics - I might want to use NWC's standard values. I'll now try to "conduct" (add agogics, volume, velocity, tempo, ornaments, ...) to the four symphony movements = this has not much to do with MXML2NWC.  After that, I'll try the process with another symphony - I have three or four more scans lying around here!

H.M.

 

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #23
Help !  This error message means nothing to me !


Any help appreciated.


Rich.
Rich.


Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #25
Sent

R.
Rich.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #26
Hi Richard,

The error occurs in the first measure, when trying to determine the length of the first element. This is done  by means of the <duration> element.

Excerpts from the musicmxl reference:
<duration>:
"Duration is a positive number specified in division units."

<divisions>
"Parent element: <attributes>
Musical notation duration is commonly represented as fractions. The <divisions> element indicates how many divisions per quarter note are used to indicate a note's duration. "

<attributes>
"The <attributes> element contains musical information that typically changes on measure boundaries. This includes key and time signatures, clefs, transpositions, and staving."

So, in order to determine the length of a note or rest, the division unit must be known, which is part of a <attributes> element.
In your file, the first <attributes> element occurs for the first time in measure 6, so the division unit is not known before that.

When I moved the <attributes> element to the start of measure 1 in your xml file, the error didn't occur anymore.
I'll send you a personal mail with the corrected xml file and the resulting nwctxt file (happy tune, by the way).
Always look on the bright side of life!

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #27
Hi Opagust,

Thank you.  I shall continue to test where I am able to.

A question following on from this please.
I think the error occurred because in the original pdf file, the voice staff does not start until the second system.
Therefore the program that generated the mxl file did not place any duration information for the voice line until the second system (measure 6).

There are many songs where either voice or an instrument starts at a later measure, and the xml generating program will only show duration info t the point the music for that staff starts. However, the staff is placed there at the beginning giving the error you have described.

Are you planning to overcome this in a later version of your program or will it be expected that a user tries to edit the mxl file in text editor in order to resolve the problem.  ( I probably would not know what to look for !)

Nice job by the way  look forward to further versions.


Cheers

Rich.

Rich.

Re: MUSICXML TO NOTEWORTHY CONVERTER

Reply #28
Hi Rich,

As I said, I'm working on the next version.

I think it's not too difficult to include a 'look ahead' and search for a divisions element further in a staff, before starting to  process the first measure.
That should solve the problem.

I hope to publish the next version soon.

In the meanwhile, if you have the same problem in another xml file:
- Open the file in a text editor and look for the first occurence of  '<attributes>
- Before that you'll find a preceding line with '<measure number =...'
- If it's the same error situation, that measure number will be > 1.
- Then copy all the lines from '<attributes>' to '</attributes>', as in your file:
Code: [Select · Download]
	
<attributes>
<divisions>2</divisions>
<key>
<fifths>-4</fifths>
</key>
<clef>
<sign>G</sign>
<line>2</line>
</clef>
</attributes>
- Now look higher in the file for a line with '<measure number="1">'
- Paste the copied lines after that line
- Save the file with another name.
Always look on the bright side of life!