pitchtypes.basetypes.AbstractInterval
- class pitchtypes.basetypes.AbstractInterval
 Bases:
ABCThe basic interface implemented by every interval (and interval class) type.
- __init__()
 
Methods
__init__()abs()For downward intervals, return their upward counterpart, otherwise just return the interval itself.
Determines the direction of the interval: 1 for up, -1 for down and 0 for neutral.
embed()For interval classes, return an embedding into the interval space in a (type-dependent) default octave.
ic()Return the interval class that corresponds to this interval.
octave(**kwargs)Create the octave interval of this type.
to_class()Alias for ic(), but also supported by pitch types.
unison(**kwargs)Create the unison interval of this type.
- abstractmethod __abs__()
 For downward intervals, return their upward counterpart, otherwise just return the interval itself.
- __add__(other)
 Returns the sum of two intervals.
- __eq__(other)
 Return self==value.
- __hash__ = None
 
- __mul__(other)
 Returns an integer multiple of the interval.
- __neg__()
 Returns the inversion of the interval (same size in the other direction).
- __rmul__(other)
 Returns an integer multiple of the interval.
- __sub__(other)
 Returns the difference of two intervals.
- __weakref__
 list of weak references to the object
- abs()
 For downward intervals, return their upward counterpart, otherwise just return the interval itself.
- Returns:
 the absolute interval
- abstractmethod direction()
 Determines the direction of the interval: 1 for up, -1 for down and 0 for neutral. Different types may have different conventions for the direction of an interval.
- Returns:
 the interval’s direction (
-1/0/1, integer)
- abstractmethod embed()
 For interval classes, return an embedding into the interval space in a (type-dependent) default octave. For non-class intervals, return the interval itself.
- Returns:
 a non-class version of this interval
- abstractmethod ic()
 Return the interval class that corresponds to this interval. If the interval is already an interval class, it is returned itself.
- Returns:
 the interval’s corresponding interval class
- abstractmethod classmethod octave(**kwargs)
 Create the octave interval of this type.
- Returns:
 an octave interval
- to_class()
 Alias for ic(), but also supported by pitch types.
- Returns:
 the interval’s corresponding interval class
- abstractmethod classmethod unison(**kwargs)
 Create the unison interval of this type.
- Returns:
 a unison interval