tonal-fretboard

Filter notes

Usage no npm install needed!

<script type="module">
  import tonalFretboard from 'https://cdn.skypack.dev/tonal-fretboard';
</script>

README

tonal-fretboard npm version

tonal

tonal-fretboard is a module to represent notes in a fretboard.

This is part of tonal music theory library.

You can install via npm: npm i --save tonal-fretboard

API Reference

tuning(name)Array

Given a tuning name, returns the notes of the strings in the open position

simpleTuning(name)Array

Given a tuning name returns the notes of the strings in open position as pitch classes removing doubled strings.

names(aliases)Array

Get all available tuning names

build(tuning, first, last)Array

Build a fretboard using a given tuning (or tuning name) and first and last fret numbers

scale(tuning, scale, first, last)Array

Build a fretboard only showing the notes for the given scale.

chordShapes(tuning, notes, first, last, span)Array

Build an array of reachable chord shapes based on given notes and tuning.

tuning(name) ⇒ Array

Given a tuning name, returns the notes of the strings in the open position

Kind: global function
Returns: Array - the string notes or null if not valid tuning name

Param Type Description
name String the tuning name

Example

var fret = require('tonal-fretboard')
fret.tuning('guitar') // => [ 'E2', 'A2', 'D3', 'G3', 'B3', 'E4' ]
fret.tuning('charango') // => [ 'G4', 'G4', 'C5', 'C5', 'E5', 'E4', 'A4', 'A4', 'E5', 'E5' ]

simpleTuning(name) ⇒ Array

Given a tuning name returns the notes of the strings in open position as pitch classes removing doubled strings.

Kind: global function
Returns: Array - the string notes as pitch classes

Param Type Description
name String the tuning name or notes of the strings in open position

Example

fret.simpleTuning('guitar') => [ 'E', 'A', 'D', 'G', 'B', 'E' ]
fret.simpleTuning('charango') => [ 'G', 'C', 'E', 'A', 'E' ]

names(aliases) ⇒ Array

Get all available tuning names

Kind: global function
Returns: Array - an array of tuning names

Param Type Description
aliases Boolean get aliases or not

build(tuning, first, last) ⇒ Array

Build a fretboard using a given tuning (or tuning name) and first and last fret numbers

Kind: global function
Returns: Array - An array of arrays, one for each string

Param Type Description
tuning String | Array the tuning name or notes
first Integer the first fret number
last Integer the last fret number

scale(tuning, scale, first, last) ⇒ Array

Build a fretboard only showing the notes for the given scale.

Kind: global function
Returns: Array - An array of arrays, one for each string

Param Type Description
tuning String | Array the tuning name or notes
scale String | Array the scale notes
first Integer the first fret number
last Integer the last fret number

chordShapes(tuning, notes, first, last, span) ⇒ Array

Build an array of reachable chord shapes based on given notes and tuning.

Kind: global function
Returns: Array - An array of arrays, one for each possible shape.

Param Type Description
tuning String | Array the tuning name or notes
notes Array an array of chord notes
first Integer the first fret number
last Integer the last fret number
span Integer how many frets to include per position