alda-lang / alda

A music programming language for musicians. :notes:
https://alda.io
Eclipse Public License 2.0
5.62k stars 290 forks source link

Complete MusicXML Import #475

Closed Scowluga closed 1 year ago

Scowluga commented 1 year ago

Background

Currently for MusicXML import, we are able to go from MusicXML to Alda []ScoreUpdate. The following 3 PRs combined will introduce an Alda code generator to complete the import process:

  1. https://github.com/alda-lang/alda/pull/471
  2. https://github.com/alda-lang/alda/pull/474
  3. https://github.com/alda-lang/alda/pull/475

This PR finally finishes the alda import command and marks it as no longer hidden / experimental.

Command

score-partwise

As mentioned in code comments, I considered looking into applying the XSLT stylesheet directly in code to ensure score-timewise MusicXML files are converted automatically to score-partwise. Turns out nobody really uses score-timewise, so it's not quite worth the additional dependencies.

MusicXML version

We now log a warning for MusicXML versions that are not 3.1. The current new version is 4, which most people should hopefully be using. The warning message may get annoying, but I don't think I'll have sufficient time to ensure import is working with version 4. Furthermore, in the future, there may be even newer (and even older) versions that just mess everything up. Better to warn.

Importer Changes

We are only trying to achieve a baseline importer that gets you 90% of the way to a complete Alda score.

There will be various issues with importing, especially when handling edge cases and complex MusicXML files.

I made various additional commits improving the MusicXML importer to get to what I believe is a fair baseline correctness. These are in separate commits with descriptive commit messages.