pitchtypes.spelled.AbstractSpelledInterval

class pitchtypes.spelled.AbstractSpelledInterval

Bases: ABC

The interface for spelled interval types.

__init__()

Methods

__init__()

diatonic_steps()

Return the diatonic steps of the interval (unison=0, 2nd=1, ..., octave=7, ...).

generic()

Return the generic interval, i.e. the number of diatonic steps modulo octave.

__weakref__

list of weak references to the object

abstractmethod diatonic_steps()

Return the diatonic steps of the interval (unison=0, 2nd=1, …, octave=7, …). Respects both direction and octaves.

Returns:

number of diatonic steps (integer)

abstractmethod generic()

Return the generic interval, i.e. the number of diatonic steps modulo octave. Unlike degree(), the result respects the sign of the interval (unison=0, 2nd up=1, 2nd down=-1).

Returns:

generic interval (integer)