Not logged in

abc2svg interface 1

This document describes the interface of the abc2svg core version 1 (abc2svg-1.js).

Changes in the version 1.17.0


The abc2svg core may be included in html/xhtml documents by:

<script src="" type="text/javascript"></script>

This script defines a global variable, abc2svg, which contains the global variables and functions of the core.

Before any first or new ABC to SVG translation, an instance of the class Abc must be created:

var abc = new abc2svg.Abc(user)

The user argument of this function is a javascript Object which must or may contain:

ABC to SVG translation

ABC to SVG translation is done calling the Abc method tosvg:

        abc.tosvg(file_name, ABC_source, start_offset, end_offset)

abc.tosvg may be called many times in which case the values set by previous calls are kept.

The ABC source must contain full tunes, i.e. a same tune cannot be continued by a second call to tosvg.

Exported attributes and methods of the Abc class

Global variable

The global variable abc2svg contains the global variables and functions of the abc2svg core.


Some abc2svg specific features are not directly included in the core. They are handled in separate modules.

These modules may be concatenated with the core or may stay on the Web server.

When the modules stay on the server, each ABC source must be scanned to find if it uses some specific features.
This is done calling the function abc2svg.modules.load(). This function expects one or two arguments:

It returns true when all the needed modules are loaded (no new feature). In this case, the function ondone() is not called.
When false is returned, the caller is alerted via the callback function ondone().