Module musx.mxml.mode

An enumeration of the diatonc modes: MAJOR, MINOR, IONIAN, DORIAN, PHRYGIAN, LYDIAN, MIXOLYDIAN, AEOLIAN, and LOCRIAN. IONIAN and AEOLIAN are synonyms for MAJOR and MINOR

Expand source code
"""
An enumeration of the diatonc modes: MAJOR, MINOR, IONIAN, DORIAN,
PHRYGIAN, LYDIAN, MIXOLYDIAN, AEOLIAN, and LOCRIAN. IONIAN and AEOLIAN
are synonyms for MAJOR and MINOR
"""

from enum import IntEnum


class Mode (IntEnum):

    MAJOR = 1
    IONIAN = MAJOR
    DORIAN = 2
    PHRYGIAN = 3
    LYDIAN = 4
    MIXOLYDIAN = 5
    MINOR = 6
    AEOLIAN = MINOR
    LOCRIAN = 7
    
    def tonic_degree(self):
        """
        Returns the integer scale degree number representing the starting
        scale degree of the mode. Thus IONIAN and MAJOR are 0, DORIAN is
        1, LOCRIAN is 6 and so on.
        """
        return self.value - 1

Classes

class Mode (*args, **kwds)

Enum where members are also (and must be) ints

Expand source code
class Mode (IntEnum):

    MAJOR = 1
    IONIAN = MAJOR
    DORIAN = 2
    PHRYGIAN = 3
    LYDIAN = 4
    MIXOLYDIAN = 5
    MINOR = 6
    AEOLIAN = MINOR
    LOCRIAN = 7
    
    def tonic_degree(self):
        """
        Returns the integer scale degree number representing the starting
        scale degree of the mode. Thus IONIAN and MAJOR are 0, DORIAN is
        1, LOCRIAN is 6 and so on.
        """
        return self.value - 1

Ancestors

  • enum.IntEnum
  • builtins.int
  • enum.ReprEnum
  • enum.Enum

Class variables

var AEOLIAN
var DORIAN
var IONIAN
var LOCRIAN
var LYDIAN
var MAJOR
var MINOR
var MIXOLYDIAN
var PHRYGIAN

Methods

def tonic_degree(self)

Returns the integer scale degree number representing the starting scale degree of the mode. Thus IONIAN and MAJOR are 0, DORIAN is 1, LOCRIAN is 6 and so on.

Expand source code
def tonic_degree(self):
    """
    Returns the integer scale degree number representing the starting
    scale degree of the mode. Thus IONIAN and MAJOR are 0, DORIAN is
    1, LOCRIAN is 6 and so on.
    """
    return self.value - 1