A JavaScript library for rendering Gregorian Chant in square note notation
exsurge allows developers to create SVG images of square note notation from gabc notation. These SVGs can then be inserted in the DOM or used for presentation purposes.
Want to see gabc code rendered to chant on the fly? Try going here.
First, create a ChantContext which contains the settings for how the chant will be rendered:
var ctxt = new exsurge.ChantContext();
Then, create a ChantScore from gabc code:
var gabc = "(f3) EC(ce!fg)CE(f) *(,) ad(fe~)vé(f!gwhf)nit(f) (,)"
var mappings = exsurge.Gabc.createMappingsFromSource(ctxt, gabc);
var score = new exsurge.ChantScore(ctxt, mappings, true);
Finally, let the ChantScore handle the layout process, and use the SVG however you want:
// perform layout on the chant
score.performLayout(ctxt, function() {
score.layoutChantLines(ctxt, 1000, function() {
// render the score to svg code
var svgNode = document.createElement('div');
var innerHtml = score.createDrawable(ctxt);
svgNode.innerHTML = innerHtml;
document.body.appendChild(svgNode);
});
});
Very few good chant layout software exist for developers. exsurge allows web developers to insert beautiful chant into their workflow with the simplicity of a little JavaScript.
After grabbing the repo from github, it's a simple matter of using npm
to build exsurge:
npm install
npm run build
Alternatively, you can run npm run dev
which will watch and compile the library after saved each change.
Under construction...
Under construction...
Under construction...
MIT License: http://adampritchard.mit-license.org/ or see the LICENSE
file.