Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
/ abc-render-svg Public archive

Render ABC music notation to SVG in a Node environment

License

Notifications You must be signed in to change notification settings

folkdb/abc-render-svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@folkdb/abc-render-svg

Render ABC music notation to SVG in a Node environment

Install

npm i @folkdb/abc-render-svg

Usage

This package is released as an ES module only. Minimum Node.js version is 12 (latest LTS as of release date). CommonJS require() is not supported.

import abcRenderSvg from '@folkdb/abc-render-svg'

(async () => {
  const svg = await abcRenderSvg(`
    X:1
    T:Notes
    M:C
    L:1/4
    K:C
    c d e f|g a b c'|]
  `);
  
  // do something with SVG
})();
  

API

The module's default export is a function with the following parameters:

function(content: string, options = {}): string

Required

  • content: the ABC string to be rendered to SVG

Rendering Options

  • options: additional options passed to the abcjs library's renderAbc function