lenmus / lomse

A C++ library for rendering, editing and playing back music scores.
MIT License
117 stars 28 forks source link

Add MusicXML export capabilities #361

Closed cecilios closed 2 years ago

cecilios commented 2 years ago

In order to fully support MusicXML this PR is a first step to add MusicXML export capabilities.

As this is a lot of work, I prefer to build this feature incrementally in several PRs than having a whole amount of code waiting until everything is finished.

With this PR lomse starts supporting MusicXML export and most Lomse supported notation is currently exported. Notably exceptions:

Usage is very simple:

    ADocument doc = pPresenter->get_document();
    MxlExporter exporter(*lomse.get_library_scope());
    std::string source = exporter.get_source( doc.first_score() );

    //do whatever you like with the MusicXML source code. For instance,
    //display it in the console
    cout << source << endl;

You can find a simple sample program to play with at examples/other/musicxml-export.cpp.