Chord class¶
-
class
Chord¶ Child class of
NoteList, uses same constructor. Is hashable. ContainsNoteobjects, as well as functions to analyze chords. Accepts either a single iterableNotes, or a bunch ofNotes. Typically constructed using the inherited functionsNoteList.from_ascii()orNoteList.from_midi_list()-
chords¶
Class attribute, dictionary of chord names and semitones from chords.json, exported from https://en.wikipedia.org/wiki/List_of_chords
-
identify()¶
Identify what chord this is. Most chords here are valid. https://en.wikipedia.org/wiki/List_of_chords. Returns a list of chord names that match the current
Chordobject.Returns: List of chord names in format “note_ascii chord_name”, e.g. “C4 Major” -
classmethod
from_ident(ident_chord_name)¶
Used to create a
Chordfrom an identified chord, e.g. ‘C4 Major.Parameters: ident_chord_name (str) – Chord name similar to what identify()outputs.Raises: AssertionEror – If ident_chord_namedoesn’t have a space in it to separate the chord name from the base.-
classmethod
from_note_chord(note_obj, chord_name)¶
Used to create a
Chordfrom aNoteand a chord nameParameters: Returns: -
classmethod
_get_semitones_from_chord_name(chord_name)¶
Return the 1st semitone from the list of semitones in chords.json for a given
chord_nameParameters: chord_name (str) – String name of chord, see names of chord in chords.json. e.g. “Major”, or “Harmonic seventh” Returns: Semitones from the base for each note in a chord Return type: list of ints Raises: ValueError – When the function can’t find a chord with the chord_name-