Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 700 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 700 Bytes

frettable

determine if a set of notes can be physically fretted on guitar

Installation

npm install frettable --save

Usage

Frettable takes an array of notes, each representing the fret on a standard 6-string guitar. An open note is represented as 0, and a muted note as -1. An open D chord would look like [-1, -1, 0, 2, 3, 2]

Based on the possible fingerings, frettable will determine whether or not the chord is "frettable."

const frettable = require('frettable');
let chord;

chord = [-1, -1, 0, 2, 3, 2]; // D chord
console.log(frettable(chord)); // true

chord = [1, 2, 3, 4, 5, 6];
console.log(frettable(chord)); // false - this chord is impossible to fret