twelvetet-fretboard
A small fretboard utility library for Javascript. It helps you manipulate pitches on a fretboard.
Last updated 2 years ago by adriano.digiovanni .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install twelvetet-fretboard 
SYNC missed versions from official npm registry.

TwelveTetFretboard

TwelveTetFretboard is a small fretboard utility library for Javascript. It helps you manipulate pitches on a fretboard.

Please, refer to the Installation, Usage and API sections for more information.

Installation

Install the latest stable version of TwelveTetFretboard using npm:

npm install twelvetet-fretboard twelvetet

You can also access the files on unpkg.com.

You can use TwelveTetFretboard with module bundlers.

The npm package includes precompiled production and development UMD builds in the dist/ folder. They can be used without a bundler.

The UMD builds make TwelveTetFretboard available as window.TwelveTetFretboard global variable.

TwelveTetFretboard works in any modern browser and Node.js.

Usage

import Fretboard from 'twelvetet-fretboard'

const tuning = ['E2', 'A2', 'D3', 'G3', 'B3', 'E4'] // standard guitar tuning
const numFrets = 12
const fretboard = new Fretboard(tuning, numFrets)

console.log(fretboard.at(0, 0).toString())          // E4

API

Classes

TwelveTetFretboard

Typedefs

Position

TwelveTetFretboard

Kind: global class

new TwelveTetFretboard(tuning, numFrets, [tuningFrequency])

Param Type Description
tuning Array An array of values representing fretboard tuning.
numFrets Number A positive integer indicating the number of frets.
[tuningFrequency] Number An optional positive number indicating the tuning frequency.

Example

import Fretboard from 'twelvetet-fretboard'

const tuning = ['E2', 'A2', 'D3', 'G3', 'B3', 'E4'] // standard guitar tuning
const numFrets = 12
const fretboard = new Fretboard(tuning, numFrets)

console.log(fretboard.at(0, 0).toString())          // E4

twelveTetFretboard.positions

Kind: instance property of TwelveTetFretboard
Properties

Name Type Description
positions Array.<Position> An array of all the positions on the fretboard

twelveTetFretboard.at(aStringIndex, aFretIndex) ⇒ Pitch

Returns the pitch at (stringIndex, fretIndex)

Kind: instance method of TwelveTetFretboard

Param Type Description
aStringIndex Number A zero-based integer indicating the string
aFretIndex Number A zero-based integer indicating the fret

Position

Kind: global typedef
Properties

Name Type Description
pitch Pitch The pitch at (stringIndex, fretIndex).
stringIndex Number A zero-based integer indicating the string
fretIndex Number A zero-based integer indicating the fret

License

This project is MIT-licensed

Current Tags

  • 0.1.2                                ...           latest (2 years ago)

3 Versions

  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 3
Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |