Skip to content
/ exsurge Public
forked from frmatthew/exsurge

A JavaScript library for rendering Gregorian Chant in square note notation

License

Notifications You must be signed in to change notification settings

SirPL/exsurge

 
 

Repository files navigation

exsurge

A JavaScript library for rendering Gregorian Chant in square note notation

Synopsis

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.

Live Browser Example

Want to see gabc code rendered to chant on the fly? Try going here.

Code Example

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 score = exsurge.Gabc.loadChantScore(ctxt, gabc, 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);
  });
});

Motivation

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.

Installation

Under construction...

API Reference

Under construction...

Tests

Under construction...

Contributors

Under construction...

License

MIT License: http://adampritchard.mit-license.org/ or see the LICENSE file.

About

A JavaScript library for rendering Gregorian Chant in square note notation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.3%
  • HTML 0.7%