Reputation: 33
I have some music in the MusicXML format (.mxl
files). How can I convert these files to ABC notation (.abc
files)? Can music21 do it?
Upvotes: 3
Views: 746
Reputation: 705
You could hack something with node and xml2abc. Mxl is musicxml in a zip file.
Here is a code snippet i use in zupfnoter; It
function pasteXml(text){
try{
var xmldata = $.parseXML(text);
}
catch(ex){
#{$log.error(`ex.message`)}
}
var options = {
'u': 0, 'b': 0, 'n': 0, // unfold repeats (1), bars per line, chars per line
'c': 0, 'v': 0, 'd': 0, // credit text filter level (0-6), no volta on higher voice numbers (1), denominator unit length (L:)
'm': 0, 'x': 0, // with midi volume and panning (1), no line breaks (1)
'p': 'f'
}; // page format: scale (1.0), width, left- and right margin in cm
result = vertaal(xmldata, options);
return result;
}
function pasteMxl(text){
zip = new JSZip(text);
text = zip.file(/^[^/ ]*\.xml$/)[0].asText();
pasteXml(text);
}
Upvotes: 1
Reputation: 2449
Have you tried this web service instead? http://www.mandolintab.net/abcconverter.php
Upvotes: 0
Reputation: 3638
music21
does not currently have the ability to export abc, only import.
Upvotes: 3