truj / midica

A Music programming language. Translates source code into MIDI. Includes a player. Supports MIDI-Karaoke. Includes a MIDI analyzer.
https://www.midica.org/
Mozilla Public License 2.0
111 stars 13 forks source link

Add support for ALDA 2 in the decompiler and importer #73

Closed truj closed 1 year ago

truj commented 2 years ago

There are some slight syntax differences between ALDA 1 and 2. The decompiler was made before ALDA 2 came out. Also the CLI might be different.

Maybe it's easy enough to support both versions. But if that's too much overhead, it should be ok to skip ALDA 1 support at all. I guess most people won't use it any more.

truj commented 1 year ago

Key signatures need to be converted in the decompiler. Everything else still works.

The importer can check the alda version and then decide what to do.

In the exporter this is not so reasonable because the target could be another system. Of cause I could add a checkbox to choose the target version but I think that's not worth it. So my decision is to stop supporting decompilation to alda 1.

truj commented 1 year ago

Upgrade finally done.

As ALDA 2 doesn't crash on too many MIDI channels any more, I was able to improve the Unit tests to import/export/re-import from/to several formats. This revealed some bugs in other parts that I didn't find so far, and that are also fixed within this issue.

Two things are a little annoying:

A little more background information for those who are interested

I improved the MidicaPL language a lot in #79, now supporting bar lines and more compact syntax, taking inspiration from ALDA. Then I wanted to support all these improvements in the exporter as well. That's what I did in #80, improving the decompiler a lot by the way. I applied these changes also in the ALDA exporter (still in #80).

Here the improvements from #80:

That was a lot of work. Compared to that, the upgrade to supporting ALDA 2 was trivial. In the exporter I only had to change the key signatures.