Guitar

new Guitar(string tuning)

Guitar object
Parameters:
Name Type Argument Default Description
tuning string <optional>
standard initializes the guitar object with a tuning defaults to "standard" guitar tuning E A D G B E You can find more tunings in MUSIQ.tunings
Source:

Members

<static> FRETS_SHOWN

the number of frets shown in any visual representation (default value = 16 )
Source:

<static> tunings

An object array with a number of different guitar tunings.
Source:
To Do:
  • add more tunings

Methods

activeMatches() → Array.<Note>|Array.<Chord>

Source:
Returns:
a match array with Note objects that match this finger position
Type
Array.<Note> | Array.<Chord>

activeNotes() → GuitarNote[]

Source:
Returns:
of GuitarNote objects representing all the active notes on the guitar neck
Type
GuitarNote[]

chordFromFingerPos(integer[] positions)Chord

returns one chord based on the finger positions for the individual strings
Parameters:
Name Type Description
positions integer[] the finger positions on the individual strings -1 represents
Source:
Returns:
a chord object that matches this fingering position. If no chord is found, null is returned.
Type
Chord

chordsFromActiveNotes() → array

Source:
Returns:
an array of Chord objects from the active notes played on the guitar
Type
array

chordsFromFingerPos(array positions) → Chord[]

returns a list of chords based on the finger positions for the individual strings
Parameters:
Name Type Description
positions array the finger positions on the individual strings
Source:
Returns:
an array of chords that match this fingering position
Type
Chord[]

clearFretboard()Guitar

clear all active or ghosted notes from the fretboard
Source:
Returns:
the Guitar object
Type
Guitar

notationFor(integer str, integer fret) → string

get the notation for a note on the specified string and fret
Parameters:
Name Type Description
str integer the string selected (int)
fret integer the selected fret (int)
Source:
Returns:
the notation for a position on the fretboard
Type
string

noteOnPos(integer[] pos)GuitarNote

get the note on a specific position on the fretboard
Parameters:
Name Type Description
pos integer[] an array like [ string, fret ]
Source:
Returns:
Type
GuitarNote

notesFromFingerPos() → integer[]

Source:
Returns:
a list of integers representing the MIDI notes for all finger positions
Type
integer[]

notesOnFret(integer fretNr) → GuitarNote[]

get all notes on a particular fret
Parameters:
Name Type Description
fretNr integer the number of the fret to look for
Source:
Returns:
an array of GuitarNote objects
Type
GuitarNote[]

notesOnString(integer stringNr) → GuitarNote[]

get all notes on a particular string
Parameters:
Name Type Description
stringNr integer the the number of the string to look for
Source:
Returns:
an array of GuitarNote objects
Type
GuitarNote[]

posFromChord() → array

get all possible fingering positions from a chord
Source:
To Do:
  • implement this method
Returns:
an array with all possible fingerings
Type
array

show(array matches)Guitar

show function: shows chords, notes or scales on the fretboard
Parameters:
Name Type Description
matches array an array of Chord / Note / Scale objects to be shown
Source:
Returns:
- the Guitar object
Type
Guitar

showChords(array chords)Guitar

show all the notes of a list of chords on the fretboard
Parameters:
Name Type Description
chords array array of Chord objects
Source:
Returns:
the Guitar object
Type
Guitar

showFrets(array frets)Guitar

show the notes on the fretboard
Parameters:
Name Type Description
frets array an array of integers representing which note to show on what string
Source:
Returns:
the Guitar object
Type
Guitar

showNotes(array notes, object options)Guitar

show all the notes on the fretboard that match a particular array of basic notes
Parameters:
Name Type Description
notes array array with notes
options object object describing some formatting options: only: boolean, active: boolean, ghosted: boolean, tonic: boolean
Source:
Returns:
the Guitar object
Type
Guitar

showScales(array scales)Guitar

show all notes of a particular scale on the fretboard
Parameters:
Name Type Description
scales array of Scale objects
Source:
To Do:
  • implement function
Returns:
the Guitar object
Type
Guitar

showTonic(Note note)Guitar

show the tonic notes on the fret board as well
Parameters:
Name Type Description
note Note a Note object representing the current tonic
Source:
Returns:
the Guitar object
Type
Guitar

transpose(integer num)Guitar

transpose notes on the fretboard
Parameters:
Name Type Description
num integer the number of frets to transpose (negative is down, positive is up)
Source:
Returns:
the Guitar object we implement this by transposing the state objects of all the notes only
Type
Guitar

tuning(string name)Guitar

sets or gets the tuning for this guitar
Parameters:
Name Type Description
name string representing the type of tuning (default: "standard")
Source:
Returns:
this object
Type
Guitar