IntervalQuality
IntervalQuality(name: str, rel_number: float)One of the nineteen interval qualities; see QUALITIES.
>>> QUALITIES[0]
IntervalQuality("perfect", 0)
>>> QUALITIES[0.5] + 1
IntervalQuality("augmented-from_maj_min", 1.5)Attributes
| Name | Description |
|---|---|
| name | |
| rel_number | |
| chromatic_modifier | Half-steps above the diatonic base of the interval. |
| abbr | The first three letters of each word of the name, as TonalVector.from_string accepts them. |
Methods
| Name | Description |
|---|---|
| augment | The quality halfsteps half-steps wider, in the same family. |
| diminish | The quality halfsteps half-steps narrower, in the same family. |
__add__ |
augment, as an operator. |
__sub__ |
diminish, as an operator. |
__str__ |
The name in words, without the family suffix. |
__repr__ |
augment
augment(halfsteps: int = 1)The quality halfsteps half-steps wider, in the same family.
>>> QUALITIES[0].augment()
IntervalQuality("augmented-from_perfect", 1)
>>> QUALITIES[0.5].augment(2)
IntervalQuality("dbl_augmented-from_maj_min", 2.5)Raises ValueError past the ends of the table (quadruply augmented or diminished), as TonalVector.from_string does for the same overflow:
>>> QUALITIES[4.5].augment()
Traceback (most recent call last):
...
ValueError: 5.5 is beyond the supported range of interval qualities (-4.5 to 4.5).diminish
diminish(halfsteps: int = 1)The quality halfsteps half-steps narrower, in the same family.
>>> QUALITIES[0.5].diminish(), QUALITIES[0].diminish()
(IntervalQuality("minor", -0.5), IntervalQuality("diminished-from_perfect", -1))__add__
__add__(halfsteps: int)augment, as an operator.
>>> QUALITIES[-0.5] + 1
IntervalQuality("major", 0.5)__sub__
__sub__(halfsteps: int)diminish, as an operator.
>>> QUALITIES[0.5] - 2
IntervalQuality("diminished-from_maj_min", -1.5)__str__
__str__()The name in words, without the family suffix.
>>> str(QUALITIES[-3])
'trpl diminished'__repr__
__repr__()