gogins / csound-extended

Extensions for Csound including algorithmic composition, Android app, and WebAssembly.
GNU Lesser General Public License v2.1
40 stars 1 forks source link

Get CsoundAC.Score to import and export MusicXML #176

Closed gogins closed 3 years ago

gogins commented 3 years ago

I had import working long ago, and coded export but I don't recall it working. I dropped these features from my build but now I have put them back.

Import is working again I think.

I need to write a sensible test for export.

This was not much work. Unfortunately, the MusicXML library from Grame is not available as a Linux package, and must be built from source. Furthermore, only the master branch builds and installs all features I need, the dev branch has been cleaned up but consequently does not install in the right place and does not install all features that I need.

gogins commented 3 years ago

Import seems to work fine. I clearly had not finished export. I will see how much work doing that should take.

This is much more challenging than bringing the notes of a MusicXML score into Csound or CsoundAC. Furthermore the CsoundAC score is even more primitive than the Csound score, and knows nothing of tempo changes, bar numbers, and so on.

If there were code to translate a MIDI file to some sort of MusicXML, that would probably suffice as it would match the primitivity of the CsoundAC score.

In fact, MuseScore does a pretty damn good job of bringing a CsoundAC-generated MIDI file into notation that can be followed, and this of course can then be exported as MusicXML.

Doing much more than that, would involve adding a lot of decoration to the CsoundAC Event and Score classes. The Event has a property map that might support this, but I think I do not feel like doing this much work.

gogins commented 3 years ago

This is a hasty survey of available software, hopefully libraries that are open source:

It may be that humdrum, music21, or jfugue has code that I can adapt. If not I will forget about export.

gogins commented 3 years ago

On reflection, I am not doing export. Adding more functionality that I can already get by exporting MIDI and reading into MuseScore etc., when I would seldom actually use MusicXML export, does not make sense at this time.

In the meantime, MusicXML import seems to work fine and I will document and maintain it. I can see where I could actually use this.