stringsync / vexml

MusicXML to Vexflow
MIT License
20 stars 5 forks source link

Official MusicXML examples #163

Open infojunkie opened 1 year ago

infojunkie commented 1 year ago

I thought I'd let you know that I wrote a script to scrape the MusicXML examples from the W3C site.

Here's the script and here are the saved examples.

Unfortunately, most of those are incomplete MusicXML fragments that lack the overall "score" or "measure" structures. I would be willing to modify the scraper to add those structures, if you are interested to incorporate them into your tests.

jaredjj3 commented 1 year ago

This is great! Yes, I'm interested because no one is going to capture the intent of the spec better than the source itself.

If you don't already have a MusicXML conformance solution already in mind, you might find https://github.com/stringsync/musicxml useful. The caveat is that you will still need a way to bridge between the example root node and the generated classes in that library.

If you really have time, I would appreciate it if you found some order that prioritizes the most impactful engravings (in Western music). It doesn't have to be very scientific or complete. You don't have to rename the files — maybe just a comment?

jaredjj3 commented 1 year ago

My stab using GPT4:

Selecting the top 20 most impactful filenames for visual regression tests in the context of Western music involves considering the elements that are most commonly used and critical for the representation of a wide variety of musical pieces. Here is a prioritized list of the top 20 filenames based on their importance in Western music notation:

  1. treble-clef.musicxml
  2. bass-clef.musicxml
  3. alto-clef.musicxml
  4. tenor-clef.musicxml
  5. barline-element.musicxml
  6. time-modification-element.musicxml
  7. key-element-traditional.musicxml
  8. time-element.musicxml
  9. note-element.musicxml
  10. rest-element.musicxml
  11. chord-element.musicxml
  12. beam-element.musicxml
  13. tuplet-element-regular.musicxml
  14. slur-element.musicxml
  15. articulations-element.musicxml
  16. dynamics-element.musicxml
  17. accidental-element.musicxml
  18. tie-element.musicxml
  19. staccato-element.musicxml
  20. tenuto-element.musicxml
eliot-akira commented 1 year ago

Just to add to the discussion, I found the W3C site also has MusicXML examples in the specs for MNX, a new proposed standard for representing music notation.

For each example, it shows the notation in MNX format, and a link to compare with MusicXML format. The links all go to heading anchors on the same page:

I don't know how they're generating this page from their repo (w3c/mnx), but it looks like a good collection of music notation examples in MusicXML, MNX, and PNG images.

jaredjj3 commented 1 year ago

@eliot-akira thanks for chiming in. This seems like a better option for a first pass, then the suite that @infojunkie is working on could be for comprehensive coverage.

infojunkie commented 1 year ago

The examples at https://github.com/infojunkie/musicxml-midi/tree/main/test/data/examples are now fully valid MusicXML. Feel free to reuse them as needed in your repo.

jaredjj3 commented 1 year ago

@infojunkie, thanks for doing the heavy lifting! I'll take a look when I'm finished with lilypond.