3

i'm trying to convert the whole Bach corpus (mxl files) to abc files. is this possible within music21?

thanks! v

Van Anders
  • 33
  • 2

3 Answers3

3

music21 does not currently have the ability to export abc, only import.

1

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);
}
Bernhard
  • 686
  • 8
  • 20
0

Have you tried this web service instead? http://www.mandolintab.net/abcconverter.php

Alex
  • 2,154
  • 3
  • 26
  • 49