Spaces:
Sleeping
Sleeping
| 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); | |
| } |