rism-digital / verovio

🎵 Music notation engraving library for MEI with MusicXML and Humdrum support and various toolkits (JavaScript, Python)
https://www.verovio.org
GNU Lesser General Public License v3.0
661 stars 183 forks source link

JS toolkit generates invalid MEI-Basic #3529

Closed musicog closed 10 months ago

musicog commented 11 months ago

Discovered by @wergo

Describe the problem When loading a valid MEI 4.0.1 encoding as MEI-Basic, invalid MEI is generated.

To Reproduce Steps to reproduce the behavior:

  1. Inspect this valid MEI 4.0.1 encoding in mei-friend. Note that it validates successfully.
  2. Click on File->Save as MEI Basic to generate an MEI Basic version using the Verovio JS Toolkit's tk.getMEI({ basic: true }) and store the file locally
  3. Open the generated file using File->Open file (or, click here to open the GitHub gist I've uploaded of the file).
  4. Note that mei-friend correctly loads the MEI 5.0 Basic schema, but the validator produces five validation errors:
Line 17: Did not expect element respStmt there
Line 22: Did not expect element encodingDesc there
Line 34: Did not expect element scoreDef there
Line 35: Element score has extra content: scoreDef
Line 65: Element scoreDef has extra content: pgFoot

Expected behavior Valid MEI should produce valid MEI Basic.

Input data Valid MEI 4.0.1 encoding: https://raw.githubusercontent.com/trompamusic-encodings/Beethoven_WoO70_BreitkopfHaertel/master/Beethoven_WoO70-Breitkopf.mei Invalid MEI 5.0 Basic encoding: https://gist.githubusercontent.com/musicog/39754d97b2927c055ba59675aa085ced/raw/991f6832d2d1a497a28a98ef81fa7eab71a29b70/Beethoven_WoO70-Breitkopf-basic.mei

Verovio information

Environment information (as appropriate)

rettinghaus commented 11 months ago

The thing is that we only store the header for processing and save it back later without processing it. I don't think there is a MEI-all to MEI-basic converter out there, or is it?

lpugin commented 11 months ago

It would make sense to prune / adjust the header to something valid. I will see what I can do.