Skip to content

felixroos/svg-piano

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVG 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

About

all you need to render a correctly sized piano on the web

Resources

License

Stars

Watchers

Forks

Packages

No packages published