music.mode_by_rotation

music.mode_by_rotation(kappa=6)[source]

A diatonic mode, built by rotating the steps as eq:relacaoDia does.

e_0 = 0 and e_i = d[(i + kappa) % 7] + e_(i-1), with d the seven steps of DIATONIC_STEPS. Each rotation is one of the seven modes: kappa = 6 is ionian, and 0 through 5 are dorian, phrygian, lydian, mixolydian, aeolian and locrian.

Parameters:
kappainteger

Which rotation. Taken modulo 7, so any integer names a mode.

Returns:
tuple of integers

The seven degrees of that mode.

Parameters:

kappa (int)

Return type:

tuple[int, …]

See also

scale

the same modes, by name.

Notes

That every mode is one rotation of one pattern is the content of the equation; naming them is bookkeeping on top of it.

Examples

>>> mode_by_rotation(6)
(0, 2, 4, 5, 7, 9, 11)
>>> mode_by_rotation(6) == scale('ionian')
True
>>> [mode_by_rotation(k)[1] for k in range(3)]
[2, 1, 2]