C # in MusicXML?

Does anyone know of any libraries that can be used to write MusicXML data from C #? Similar to this: http://proxymusic.kenai.com/ (although this is one for java).

I would try not to write it manually, but if the worst happens, I will have no choice but to deduce and write MusicXML manually from my results.

+6
source share
3 answers

Since MusicXML has an available XML schema , you can use xsd.exe to create classes that represent the XML structure:

xsd /c xlink.xsd musicxml.xsd container.xsd opus.xsd 

Then you can use the XmlSerializer to load and save the generated classes from / to files.

(For some reason, one of the schema files, osfpvg.xsd, could not compile correctly. Here it is hoped that you will not need it.)

+5
source

To use xsd.exe, you can use this command:

 "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\xsd.exe" "c:\dev\musicxml30\musicxml.xsd" "c:\dev\musicxml30\xlink.xsd" "c:\dev\musicxml30\xml.xsd" /c /o:"c:\dev" 

A file is created with the name musicxml_xlink_xml.cs in the c: \ dev folder.

Compiled class

+1
source

For me, when I tried to convert MusicXml3.0.xsd , xsd.exe each time. So what I did was

 xsd.exe musicFile.xml 

which generated the schema file, and

xsd.exe musicFile.xsd / classes

which created the required c# classes. The only thing I had to add was that the generated xml should be read by programs like Sibelius 7 should add

 <!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd"> 

And presto!

+1
source

Source: https://habr.com/ru/post/891930/


All Articles