infojunkie / musicxml-midi

MusicXML to MIDI converter via Musical MIDI Accompaniment (MMA).
https://blog.karimratib.me/demos/musicxml/
GNU General Public License v3.0
12 stars 1 forks source link

Generate groove MMA via XSL transformation #47

Closed infojunkie closed 1 month ago

infojunkie commented 1 month ago

Right now, the /groove API endpoint generates an MMA script for the groove in the server.js implementation directly. This is too limiting and will present maintenance challenges down the line.

Instead, we should generate an MMA script in XSL, like other transformations. This one, called groove.xsl, would accept the same incoming parameters and use those against an empty input to generate the groove script.

The /groove endpoint would be refactored to work like the current /convert endpoint.

infojunkie commented 1 month ago

As per https://stackoverflow.com/questions/35382681/how-to-execute-a-xsl-transformation-without-input-xml-from-java it is possible to invoke a transformation, passing in a named template as the main template. The SaxonJS.transform() methods accepts an initialTemplate option for that.