GuitarNote

new GuitarNote(Guitar guitar, GuitarString guitarString, GuitarFret fret, array pos, object state)

the guitar note data object
Parameters:
Name Type Description
guitar Guitar a Guitar object this note belongs to
guitarString GuitarString a GuitarString object this note belongs to
fret GuitarFret the GuitarFret this note belongs to
pos array the position as in [ string, fret ]
state object an object representing the state of the note: active: false, ghosted: false, tonic: false
Source:

Members

<static> DEFAULT_STATE

the default state of the guitar note. when you use this, make sure to MAKE A COPY!
Source:

relPos

get the relative note position
Source:

Methods

active(boolean value) → boolean

sets or gets the active state.
Parameters:
Name Type Description
value boolean
Source:
Returns:
true if the state is active
Type
boolean

className(Note tonic) → string

get a string representation of the class
Parameters:
Name Type Argument Description
tonic Note <optional>
optionally specify a tonic. If so, the interval to the tonic is added as well
Source:
Returns:
Type
string

distanceTo() → array

get the 'distance' of a fret to another note on the fretboard
Source:
Returns:
an array with 2 elements [ strings, frets ]
Type
array

fretPos() → integer

Source:
Returns:
- number of the fret this note is on
Type
integer

ghosted(boolean value) → boolean

sets or gets the active state.
Parameters:
Name Type Description
value boolean
Source:
Returns:
true if the state is active
Type
boolean

intervalToTonic(Note tonic)Interval

the interval to the tonic
Parameters:
Name Type Description
tonic Note A Note object representing the tonic
Source:
Returns:
an Interval object relative to the tonic
Type
Interval

notation() → string

get the notation
Source:
Returns:
the notation
Type
string

notePos() → integer

get the int note position
Source:
Returns:
the MIDI position of the note
Type
integer

onlyActive(boolean value) → boolean

sets this note as the only active note on the string
Parameters:
Name Type Description
value boolean -
Source:
Returns:
Type
boolean

simple(integer signature) → string

get the short notation
Parameters:
Name Type Description
signature integer
Source:
Returns:
the Chord notation
Type
string

stringPos() → integer

Source:
Returns:
- number of the string this note is on 0 is the lowest string (in standard Guitar tuning this would be the low E)
Type
integer

tonic(Note value) → boolean

sets or gets the tonic state.
Parameters:
Name Type Description
value Note a Note object
Source:
Returns:
true if the state is tonic
Type
boolean