Utils#

fretboardgtr.utils.chromatic_position_from_root(note, root)[source]#

Get the index of the note from the root on chromatic scale.

Parameters:
  • note (str) –

  • root (str) –

Return type:

int

fretboardgtr.utils.chromatics_from_root(root)[source]#

Create list of notes chromatically starting with root.

Parameters:

root (str) –

Return type:

List[str]

fretboardgtr.utils.get_note_from_index(index, root)[source]#

Get note from chromatic scale from index and root.

Parameters:
  • index (int) –

  • root (str) –

Return type:

str

fretboardgtr.utils.get_valid_dots(first_fret, last_fret)[source]#

Get the valid fretboard dots between frets.

Parameters:
  • first_fret (int) – First fret

  • last_fret (int) – Last fret

Returns:

Valid dots between frets

Return type:

List[int]

fretboardgtr.utils.note_to_interval(note, root)[source]#

Get note from interval (int).

Parameters:
  • note (str) –

  • root (str) –

Return type:

int

fretboardgtr.utils.note_to_interval_name(note, root)[source]#

Get note from interval name.

Parameters:
  • note (str) –

  • root (str) –

Return type:

str

fretboardgtr.utils.scale_to_enharmonic(scale)[source]#

Modify the scale in order to not repeat note.

Turns into enharmonic way if possible. Otherwise return the original scale.

>>> scale_to_enharmonic(['A#', 'C', 'D', 'D#', 'F', 'G', 'A'])
    ['Bb', 'C', 'D', 'Eb', 'F', 'G', 'A']
>>> scale_to_enharmonic(["A","A#","B","C","C#","D","D#","E","F","F#","G","G#"])
    ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#']
>>> scale_to_enharmonic(['F#', 'G#', 'A#', 'B', 'C#', 'D#', 'F'])
    ['Gb', 'Ab', 'Bb', 'Cb', 'Db', 'Eb', 'F']
Parameters:

scale (List[str]) –

Return type:

List[str]

fretboardgtr.utils.scale_to_flat(scale)[source]#

Get scale replacing each note by its flat correspondant note.

Parameters:

scale (List[str]) –

Return type:

List[str]

fretboardgtr.utils.scale_to_intervals(scale, root)[source]#

Get intervals from root.

>>> scale_to_intervals(scale=['C','E','G'],root='C')
[1,3,5]
Parameters:
  • scale (List[str]) –

  • root (str) –

Return type:

List[int]

fretboardgtr.utils.scale_to_sharp(scale)[source]#

Get scale replacing each note by its sharp correspondant note.

Parameters:

scale (List[str]) –

Return type:

List[str]

fretboardgtr.utils.sort_scale(scale)[source]#
Parameters:

scale (List[str]) –

Return type:

List[str]

fretboardgtr.utils.to_flat_note(note)[source]#

Get note by replacing it by its corresponding flat note.

Parameters:

note (str) –

Return type:

str

fretboardgtr.utils.to_sharp_note(note)[source]#

Get note by replacing it by its corresponding sharp note.

Parameters:

note (str) –

Return type:

str