neoscore.western.interval

class neoscore.western.interval.Interval[source]

Bases: object

An abstract pitch interval.

__init__(specifier: str)[source]

The interval specifier should be a string in the form: [direction][quality][distance] where:

  • direction is one of:

    • 'a' for ascending

    • 'd' for descending

  • quality is one of:

    • 'm' for minor

    • 'M' for Major

    • 'P' for Perfect

    • 'd' for diminished

    • 'A' for Augmented

  • distance is any positive integer indicating the interval distance.

Some examples:

  • Interval('aM3') signifies an ascending major third

  • Interval('dA9') signifies a descending augmented ninth

property direction: DirectionY
property quality: str
property quality_in_english: str
property distance: int
property staff_distance: float

The vertical offset needed to show this interval on a staff.

The value is given in pseudo-staff-units.

>>> Interval('aM3').staff_distance
-1.0
>>> Interval('dm3').staff_distance
1.0
>>> Interval('aP1').staff_distance
0.0
>>> Interval('dP8').staff_distance
3.5
property simple_distance: float

The simplified interval distance collapsing compound intervals.

This value is the simplified version of self.distance where intervals larger than an octave are moved to be within one octave.

Examples

>>> Interval('aM10').simple_distance
3
>>> Interval('dP12').simple_distance
5