svg-piano

0.3.1 • Public • Published

SVG Piano

piano

This lib includes the rendering logic for a correctly sized piano.

Demo

Options

  • range: lowest and highest key e.g. ['A1','C6']
  • palette: array to customize color with format ['black', 'white']
  • stroke: stroke color
  • colorize: custom colorization e.g
[
  { keys: ['E2', 'Bb2'], color: 'yellow' },
  { keys: ['C2', 'G2'], color: 'brown' }
];
  • labels: add labels to certain keys:
{
  C2: '1',
  Eb2: 'b3',
  G2: '5',
  Bb2: 'b7',
}
  • visibleKeys: which pitches should be visible? e.g ['G','A','B','C','D','E','F#']
  • scaleX: changes scaling in x direction
  • scaleY: changes scaling in y direction
  • upperHeight: px height of upper area
  • lowerHeight: px height of lower area
  • strokeWidth: border width in px

Readme

Keywords

none

Package Sidebar

Install

npm i svg-piano

Weekly Downloads

50

Version

0.3.1

License

ISC

Unpacked Size

13.5 kB

Total Files

5

Last publish

Collaborators

  • felixroos