Load MXL files #2772
-
Hello, I'm trying to have Verovio loading MXL files with the toolkit as explained here: https://book.verovio.org/toolkit-reference/input-formats.html#musicxml As 'Input of MXL files is auto detected' I thought it would work effortless like any other MusicXML file. Unfortunately, with some code like:
NB : Unused ajax's DataType setting so that it can be infered. I get two errors : [Error] The tree of the MEI data cannot be parsed (no root found) in the loadData method. I double checked the MXL file:
Am I missing something ? NB : I use V 3.9.0 (but it is maybe only 3.8.1 see my previous discussion) Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi! I'm using MXL files to load sheet music as well. I think you need to convert the response to an ArrayBuffer or Base64 string, then use
If you have various files to load in different formats, something like this might be helpful:
You can see an example here: https://singpraises.net/collections/en/hymns/the-spirit-of-god?tab=sheet-music-interactive Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Great, just changed my code like :
and it worked perfectly! Thanks! |
Beta Was this translation helpful? Give feedback.
Hi! I'm using MXL files to load sheet music as well.
I think you need to convert the response to an ArrayBuffer or Base64 string, then use
vrvToolkit.loadZipDataBuffer()
orvrvToolkit.loadZipDataBase64()
to load it, instead of usingvrvToolkit.loadData()
. Here's an example using the JavaScript Fetch API, loading the file as an ArrayBuffer:If you have various files to load in different formats, something like this might be helpful: