Bb-chord-symbol
HTML5's canvas' chord symbol rendering library.
Very important part
The "bb" in bb-chord-symbol is pronounced "B flat"
Install
npm i bb-format
Usage
import
;
Basic usage
// Get a context to use for rendering;;// Create the renderer instance;// Render your chordformatter.fillChordSymbol'Bb7#9#5/D', 100, 100;
using font Petaluma Script
Advanced usage
1: tweaking the config
// Get a context to use for rendering;;// Create the renderer/formatter instance;// Modify the formatter's config;options.parentheses.type = '[]';options.useMinusSignForMinorChords = false;options.descriptor.verticalOffset = 0;options.separator.angle = Math.PI * 20 / 360;formatter.chordSymbolOptions = options;// tweak the chord's pre-layout renderer's configformatter.rendererOptions = renderConfig;// Renderformatter.fillChordSymbol'Ab7#9#5/D', 100, 100;
using font Petaluma Script
2: Post layout processing
// Get a context to use for rendering;;// Create the renderer/formatter instance;// Get a laid out chord;if !laidOutChord// rotate the all extensions// all extensions start with either a sharp or a flatlaidOutChord.fragments.filter.forEach;// renderformatter.fillTextlaidOutChord, 100, 100;
using font Petaluma Script
Well that's awesome!
bb-chord-symbol is licensed under the MIT License. That means you may do whatever you wish with it. However, developing such libraries takes considerable time and effort, so if you find it valuable, please consider supporting me with a donation via paypal.
License
MIT