hexachords / convert_to_svg.cjs
pachet's picture
created working versions folder with a working version with piano rolls.
9fa389d
raw
history blame contribute delete
535 Bytes
const verovio = require('verovio');
const fs = require('fs');
/* Wait for verovio to load */
verovio.module.onRuntimeInitialized = function ()
{
// create the toolkit instance
const vrvToolkit = new verovio.toolkit();
// read the MEI file
mei = fs.readFileSync('output.mei');
// load the MEI data as string into the toolkit
vrvToolkit.loadData(mei.toString());
// render the fist page as SVG
svg = vrvToolkit.renderToSVG(1, {});
// save the SVG into a file
fs.writeFileSync('hello.svg', svg);
}