Notes Creators#

class fretboardgtr.notes_creators.ChordFromName[source]#

Bases: object

Object generating NotesContainer object from root and chord quality.

Given a root name and a quality name, get the resulting scale.

Also : Mode name can be given thanks to the constants.ChordName enum as well as string Note name can be given thanks to the constants.NoteName enum as well as string

Example

>>> ChordFromName(root='C',quality='M').build()
    NotesContainer(root= 'C', scale = ['C', 'E', 'G'])
>>> ChordFromName(root=NoteName.C,quality=ChordName.MAJOR).build()
    NotesContainer(root= 'C', scale = ['C', 'E', 'G'])
__init__(root='C', quality='M')[source]#
Parameters:
  • root (str) –

  • quality (str) –

build()[source]#
Return type:

NotesContainer

class fretboardgtr.notes_creators.NotesContainer[source]#

Bases: object

NotesContainer(root: str, notes: List[str])

__init__(root, notes)[source]#
Parameters:
  • root (str) –

  • notes (List[str]) –

Return type:

None

get_chord_fingerings(tuning, max_spacing=5, min_notes_in_chord=2, number_of_fingers=4)[source]#

Get all probably possible fingering for a specific tuning.

Parameters:
  • tuning (List[str]) – List of note of the tuning

  • max_spacing (int) – Maximum spacing between notes

  • min_notes_in_chord (int) – Minimum number of notes in chord

  • number_of_fingers (int) – Number of fingers allowed

Returns:

List of propably possible fingerings

Return type:

List[List[Optional[int]]]

get_scale(tuning, max_spacing=5)[source]#

Get the scale of each string in the given tuning.

Goes from 0 up to (12 + max_spacing - 1) on the fretboard

Parameters:
  • (List[str]) (tuning) – The tuning of each string.

  • tuning (List[str]) –

  • max_spacing (int) –

Returns:

The scale of each string in the tuning.

Return type:

List[List[int]]

get_scale_positions(tuning, max_spacing=5)[source]#

Get all possible scale positions for a specific tuning.

Parameters:
  • tuning (List[str]) – List of note of the tuning

  • max_spacing (int) – Maximum spacing between notes

Returns:

List of all possible scale positions

Return type:

List[List[List[Optional[int]]]]

notes: List[str][source]#
root: str[source]#
class fretboardgtr.notes_creators.ScaleFromName[source]#

Bases: object

Object that generating NotesContainer object from root and mode.

Given a root name and a mode name, get the resulting scale.

Also : Mode name can be given thanks to the constants.ModeName enum as well as string Note name can be given thanks to the constants.NoteName enum as well as string

Example

>>> ScaleFromName(root='C',mode='Dorian').build()
    NotesContainer(root= 'C', scale = ['C', 'D', 'D#', 'F', 'G', 'A', 'A#'])
>>> ScaleFromName(root=Name.C,mode=ModeName.DORIAN).build()
    NotesContainer(root= 'C', scale = ['C', 'D', 'D#', 'F', 'G', 'A', 'A#'])
__init__(root='C', mode='Ionian')[source]#
Parameters:
  • root (str) –

  • mode (str) –

build()[source]#
Return type:

NotesContainer

fretboardgtr.notes_creators.find_first_index(_list, value)[source]#
Parameters:
  • _list (List[int]) –

  • value (int) –

Return type:

int | None