It permits to edit, display, print and play music from files written in ABC.
abc2svg may be used in any web browser.
The needed files are available in my site
They are updated on release change.
These files are:
This script is the abc2svg core.
It contains the ABC parser and the SVG generation engine.
It must be included in the (X)HTML header of the pages where ABC rendering is needed (in
This script is to be used with the core in (X)HTML files.
It replaces the ABC sequences by SVG images of the music (the ABC sequences start on
%abcat start of line, and stop on any ML tag).
See the %%beginml documentation for an example.
When the URL of the (X)HTML file ends with '#' followed by a string, only the tunes containing this string are displayed.
This script is also to be used in (X)HTML pages with the core.
Mainly used for ABC documentation, it lets the ABC source sequences in the page before the SVG images.
See the source of abcm2ps/abc2svg features for an example.
This script may be used with
abcemb-1.jsfor playing the rendered ABC music.
See this page for an example.
This script may be used after
play-1.jsfor highlighting the notes while playing.
See this page for an example.
This is a simple web ABC editor/player.
When looking at a ABC file in a web browser, you may also use this bookmarklet and render the music (create a bookmark and copy the link location into the address/location box).
The music is rendered as SVG images. There is one image per music line / text block.
If you want to move these images to some other files, each one must contain the full CSS and defs. For that, insert
%%fullsvg xin the ABC file before rendering (see the fullsvg documentation for more information).
Playing uses the HTML5 audio and/or midi APIs.
With the editor, if you want to render ABC files which contain
%%abc-include, you must:
- load the ABC file from the browse button
- click in the include file name
- load the include file by the same browse button
Then, you may edit and save both files.
Rendering/playing is always done from the first ABC file.
There may be only one included file.
The .js and .xhtml file names have a suffix which is the version of the core interface (actually '
Installed via npm, the abc2svg package comes with the
command line (batch) programs
These ones may be used as abcm2ps to generate XHTML or ODT files.
abc2svg writes to standard output:
abc2svg mytunes.abc > Out.xhtml
abc2odt output is
abc.odt or the file specified
by the command line argument
abc2odt my_file.abc -o my_file.odt
If you want to build the abc2svg scripts in your machine,
you must first get the files from
either as a tarball or a Zip archive
Timeline and then in the top commit),
or by cloning the repository in some directory:
fossil clone https://chiselapp.com/user/moinejf/repository/abc2svg abc2svg.fossil
fossil open abc2svg.fossil
- without minification
This is interesting for debug purpose, the scripts being more human friendly.
NOMIN=1 samu -v
- in a standard way with minification
In this case, you need the tool
uglifyjswhich comes with nodeJS.
If you also want to change or add music glyphs, you may edit the source
font/abc2svg.sfd. In this case, you will need both
samu -v font.js
If you cannot or don't want to install
samurai, you may build
the abc2svg files by
./build which is a shell script.
After building the abc2svg scripts, you will be able to generate music
sheets from the command line as you did with
abcm2ps, thanks to the
following shell scripts (the result goes to stdout):
By default, the batch scripts generate (XHTML+SVG) files.
This output may be modified by backend scripts. These ones must appear just after the command.
This script outputs back the (selected) ABC tunes of the ABC source file.
Transposition is applied.
The resulting file does not contain the formatting parameters.
abcjs24 toabc.js my_file.abc --select X:2 > tune_2.abc
This script outputs a Abiword file (ABW+SVG) which may be read by some word processors (abiword, libreoffice...) and converted to many other formats by the batch function of abiword.
The abc2svg music font (
abc2svg.ttf) must be installed in the local system for displaying and/or converting the .abw file.
abcv8 toabw.js my_file.abc > my_file.abw
This script creates an Open Document (ODT+SVG) which may be read by most word processors (abiword, libreoffice...).
It runs only with the npm script
abc2svgand asks for the npm module
jszipto be installed.
The output ODT document may be specified by the command line argument
abc2svg toodt.js my_file.abc -o my_file.odt