ProxyMusic Binder

On 14-oct-2011, UTF8 encoding was enforced for the MusicXML stream output. Before that, the encoding was by default the one selected for the current platform.

On 22-Jun-2009, the schema definitions for 'metronome', 'lyric' and 'note' were simplified in order to avoid JAXB to generate catch-all collections.

On 28-Apr-2009, ProxyMusic license switched from GPL to LGPL. Java classes were built with JAXB 2.1.3 tools.

On 12-Nov-2008, ProxyMusic was updated to generate MusicXML Java bindings directly from the schema definition, rather than from the initial DTD files.

Project Management

On http://kenai.com/projects/proxymusic/ you'll find all related management features (source code, mailing list, download area, etc).

Project Goals

ProxyMusic provides a binding between Java objects in memory and an XML file using the MusicXML format. It should provide an easy way for Java programs dealing with music symbolic information (such as score scanners, music editors, music sequencers, etc) to read or write files in MusicXML. It is released under the GNU Lesser Public License.

The binding is made available for any Java application as a dedicated jar file, which handles the latest version of MusicXML: 2.0

Requirements

JAXB2 is needed at run-time to perform marshalling or unmarshalling.

Download

Documentation

Use of the binding
A small example is available in the proxymusic.util package in the test branch, its name is proxymusic.util.HelloWorld.java. This example performs marshalling and unmarshalling of the classical HelloWorld as available in the MusicXML tutorial.
Another example, focused on the marshalling and the unmarshalling of a part-list element, is available as proxymusic.util.ScorePartTest.java
A real size example is provided by the companion Audiveris project which uses ProxyMusic to handle the marshalling of internal Java objects to a MusicXML output. This task is handled by the class ScoreExporter.java which is helped by the class MusicXML.java.
A utility class proxymusic.util.Marshalling is available to simplify the handling of both marshalling and unmarshalling.
Rebuilding the binding
Note that the rebuilding of the binding is not a mandatory task as the jar file from the download area can be used as is.

Please refer to the recipy which details the build process.

Current Status

ProxyMusic is available today in version 2.0 to support the corresponding version of MusicXML. The binding uses JAXB version 2.0 as available in Java 6.
If a user wants to handle a file in an older MusicXML version, he will simply need to use XSLT with the proper xls conversion file available on Recordare web site.

The proxymusic.util.Marshalling provides overloaded versions of a marshal method to handle output as: file, output stream or DOM node.

Foreseen Contributions

This work started as a companion of a another project whose name is Audiveris , for which I needed a suitable binding to write MusicXML. After a few discussions on MusicXML forum, especially the help provided by Dominik Wei-Fieg, I developed this binding, documented the process, and made the result available as a project separate from Audiveris.

Through Audiveris, I use this binding for marshalling only, and my experience as an end-user is satisfactory. The unmarshalling aspect has not been thoroughly tested and would benefit from another project interested in unmarshalling MusicXML files to Java.