Helper Classes¶
Quality¶
-
class
chordparser.Quality(quality_str, ext_str=None, flat_ext=False)¶ A class representing the quality of a Chord.
The Quality class composes of its base Chord quality, extensions to the Chord, and optional flats on the extended Note.
Parameters: - quality_str (str) – The Quality’s notation.
- ext_str (str, Optional) – The extended Chord’s notation.
- flat_ext (boolean, Optional) – Selector for the flat of the extended Note. Default False when optional.
-
value¶ The Quality’s notation.
Type: str
-
ext¶ The extended Chord’s notation.
Type: str, Optional
-
flat_ext¶ Selector for the flat of the extended Note. Default False when optional.
Type: boolean, Optional
-
base_intervals¶ The intervals of the triad of a Chord with this Quality.
Type: tuple of int
-
base_degrees¶ The scale degrees of the triad of a Chord with this Quality.
Type: tuple of int
-
base_symbols¶ The accidentals of the triad of a Chord with this Quality.
Type: tuple of str
-
intervals¶ The intervals of a Chord with this Quality.
Type: tuple of int
-
degrees¶ The scale degrees of a Chord with this Quality.
Type: tuple of int
-
symbols¶ The accidentals of a Chord with this Quality.
Type: tuple of str
Raises: ValueError– If a dominant chord has a value of ‘major’ (value should be ‘dominant’)ValueError– If a diminished extended chord does not have a ext of ‘diminished seventh’ValueError– If a ‘seventh’ extended chord has a flat extension (should be reflected in ext and not in flat_ext)
-
__eq__(other)¶ Compare between other Qualitys.
Checks if the other Quality has the same value, ext and flat_ext.
Parameters: other – The object to be compared with. Returns: The outcome of the value comparison. Return type: boolean Examples
>>> QE = QualityEditor() >>> q = QE.create_quality("maj9") >>> q2 = QE.create_quality("maj9") >>> q == q2 True >>> q3 = QE.create_quality("majb9") >>> q == q3 False