Enharmonic Pitch

Note: This type is functional and tested, but it does not yet conform to the general API and the documentation is still incomplete.

Overview

Enharmonic pitches and intervals are specified in 12-TET semitones, with 60 as Middle C, as in the MIDI standard. Both enharmonic pitches and intervals can be represented by integers, However, we provides wrapper classes around int to distinguish the different interpretations as pitches and intervals (and their respective class variants). Enharmonic pitches can be easily created using the Enharmonic* constructors, all of which take integers.

constructor example

printed representation

EnharmonicInterval(15) EnharmonicIntervalClass(15) EnharmonicPitch(60) EnharmonicPitchClass(60)

i15 ic3 p60 pc0

Reference

class pitchtypes.Enharmonic(value, is_pitch, is_class, **kwargs)
Interval

alias of EnharmonicInterval

IntervalClass

alias of EnharmonicIntervalClass

Pitch

alias of EnharmonicPitch

PitchClass

alias of EnharmonicPitchClass

static pitch_class_name_from_midi(midi_pitch, flat_sharp)

Return the pitch class name for the given pitch in MIDI integer. :type midi_pitch: :param midi_pitch: MIDI pitch :type flat_sharp: :param flat_sharp: whether to use flats or sharps for accidentals :return: pitch class

class pitchtypes.EnharmonicPitch(value, **kwargs)
pc()

Convert the pitch to a PitchClass. :return: EnharmonicPitchClass

class pitchtypes.EnharmonicInterval(value, **kwargs)
class pitchtypes.EnharmonicPitchClass(value, **kwargs)
pc()

Return the pitch class itself. :return: EnharmonicPitch

class pitchtypes.EnharmonicIntervalClass(value, **kwargs)