pitchtypes.enharmonic.EnharmonicPitchClass

class pitchtypes.enharmonic.EnharmonicPitchClass(value, **kwargs)

Bases: Enharmonic

__init__(value, **kwargs)

Methods

__init__(value, **kwargs)

convert_to(other_type)

convert_to_log_freq()

create_subtypes()

link_interval_class_type([skip_name_check, ...])

A decorator to link an interval class type to its base type.

link_interval_type([skip_name_check, ...])

A decorator to link an interval type to its base type.

link_pitch_class_type([skip_name_check, ...])

A decorator to link a pitch class type to its base type.

link_pitch_type([skip_name_check, ...])

A decorator to link a pitch type to its base type.

name([as_int, flat_sharp])

pc()

Return the pitch class itself.

pitch_class_name_from_midi(midi_pitch, ...)

Return the pitch class name for the given pitch in MIDI integer.

print_options([as_int, flat_sharp])

Interval

alias of EnharmonicInterval

IntervalClass

alias of EnharmonicIntervalClass

Pitch

alias of EnharmonicPitch

PitchClass

alias of EnharmonicPitchClass

__eq__(other)

Return self==value.

__getattr__(item)

This method is called when an attribute is not found in the instance’s __dict__. It allows to access the linked Pitch, Interval, PitchClass, and IntervalClass types via the base type.

__hash__()

Return hash(self).

__repr__()

Return repr(self).

__setattr__(key, value)

Implement setattr(self, name, value).

__weakref__

list of weak references to the object

A decorator to link an interval class type to its base type. :type skip_name_check: bool :param skip_name_check: skip the name check and don’t raise :type create_init: Optional[bool] :param create_init: if True, create a default __init__ method :type create_add: Optional[bool] :param create_add: if True, create a default __add__ method :type create_sub: Optional[bool] :param create_sub: if True, create a default __sub__ method :type create_mul: Optional[bool] :param create_mul: if True, create a default __mul__ method :type create_div: Optional[bool] :param create_div: if True, create a default __truediv__ method :type create_neg: Optional[bool] :param create_neg: if True, create a default __neg__ method :meta private:

A decorator to link an interval type to its base type. :type skip_name_check: bool :param skip_name_check: skip the name check and don’t raise :type create_init: Optional[bool] :param create_init: if True, create a default __init__ method :type create_add: Optional[bool] :param create_add: if True, create a default __add__ method :type create_sub: Optional[bool] :param create_sub: if True, create a default __sub__ method :type create_mul: Optional[bool] :param create_mul: if True, create a default __mul__ method :type create_div: Optional[bool] :param create_div: if True, create a default __truediv__ method :type create_neg: Optional[bool] :param create_neg: if True, create a default __neg__ method :type create_to_class: Optional[bool] :param create_to_class: if True, create a default to_class method :meta private:

A decorator to link a pitch class type to its base type. :type skip_name_check: bool :param skip_name_check: skip the name check and don’t raise :type create_init: Optional[bool] :param create_init: if True, create a default __init__ method :type create_add: Optional[bool] :param create_add: if True, create a default __add__ method :type create_sub: Optional[bool] :param create_sub: if True, create a default __sub__ method :return: a decorator that links the pitch class type to the base type :meta private:

A decorator to link a pitch type to its base type. :type skip_name_check: bool :param skip_name_check: skip the name check and don’t raise :type create_init: Optional[bool] :param create_init: if True, create a default __init__ method :type create_add: Optional[bool] :param create_add: if True, create a default __add__ method :type create_sub: Optional[bool] :param create_sub: if True, create a default __sub__ method :type create_to_class: Optional[bool] :param create_to_class: if True, create a default to_class method :meta private:

pc()

Return the pitch class itself. :return: EnharmonicPitch

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