Tonality

class paeonia.Tonality(root: 'str | PitchClass' = 'C', scale: 'str' = 'ionian', *, intervals: 'Sequence[int] | None' = None) → 'None'[source]

Bases: object

Parameters:
  • root (str | PitchClass)

  • scale (str)

  • intervals (tuple[int, ...])

analyze_pitch(pitch, *, chromatic='preserve_alteration')[source]

Analyze a pitch as a scale position.

preserve_alteration is fully theory-aware only for seven-degree tonalities, where each degree has an expected letter spelling. For chromatic and custom scales, analysis is pitch-class based.

Parameters:
  • pitch (Pitch)

  • chromatic (str)

Return type:

ScalePosition

closest(pitch)[source]

Deprecated wrapper around MIDI-distance quantization.

Parameters:

pitch (Pitch | int)

Return type:

list[Pitch]

get_pitches(indices)[source]

Deprecated wrapper around realize_pitch().

Parameters:

indices (Sequence[int])

Return type:

list[Pitch]

get_indices(pitches)[source]

Deprecated wrapper around analyze_pitch().

Parameters:

pitches (Sequence[Pitch | int])

Return type:

list[int]