1

I'm trying to load music21j in the browser (successful), and then convert an uncompressed MusicXML string into a MIDI file using the converter (not successful).

<script> 
  import * as music21j from 'https://cdn.jsdelivr.net/npm/music21j/+esm';
  console.log(music21j.default.converter.parse());

  // now how do I pass a MusicXML string to music21j and get midi back?

</script>

The code above displays the message Loading Instrument: audio will begin when this message disappears in the HTML. However, I'm not trying to load any audio -- in fact, I'd like to avoid loading any soundfonts, and simply have music21j available as a conversion tool.

So, to summarize: how can I simply pass an XML string to music21j and convert it to MIDI?

Thanks for any clarification!

ultraGentle
  • 5,084
  • 1
  • 19
  • 45
  • Music21j doesn't yet have a MIDI file export feature. Because the browser version of music21 is mostly used so that you can see notation immediately and hear it as music, file generating export has been a low priority for the team. – Michael Scott Asato Cuthbert Apr 25 '22 at 23:56
  • 1
    @MichaelScottAsatoCuthbert Good to know! I'll just mention that, as a use-case for supporting midi export, it can be nice to do playback via a library of choice, or to manipulate the midi directly using the browser APIs. – ultraGentle Apr 26 '22 at 16:12
  • 1
    Definitely -- it's on a list of improvements to eventually get to, but since no one had mentioned wanting it, it was very low priority. Now it'll be a somewhat higher priority. But probably not till 2023 at earliest unless it gets funded. – Michael Scott Asato Cuthbert Apr 26 '22 at 20:30
  • @MichaelScottAsatoCuthbert May I ask: is there a page detailing the funding process? If not, what's the procedure? – ultraGentle Apr 27 '22 at 12:40
  • 1
    https://web.mit.edu/music21/doc/about/faq.html#consulting (that's all I'll say on the subject -- don't want to be flagged for advertising for money here on SO. – Michael Scott Asato Cuthbert Apr 28 '22 at 03:16

0 Answers0