npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tonal-fretboard

v0.69.9

Published

Filter notes

Downloads

58

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

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 |