pitchtypes.enharmonic.EnharmonicPitch
- class pitchtypes.enharmonic.EnharmonicPitch(value, **kwargs)
Bases:
Enharmonic
- __init__(value, **kwargs)
Methods
__init__
(value, **kwargs)convert_to
(other_type)convert_to_log_freq
()create_subtypes
()freq
()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])octaves
()pc
()Convert the pitch to a PitchClass.
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])to_class
()Attributes
midi
- 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
- classmethod link_interval_class_type(skip_name_check=False, create_init=None, create_add=None, create_sub=None, create_mul=None, create_div=None, create_neg=None)
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:
- classmethod link_interval_type(skip_name_check=False, create_init=None, create_add=None, create_sub=None, create_mul=None, create_div=None, create_neg=None, create_to_class=None)
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:
- classmethod link_pitch_class_type(skip_name_check=False, create_init=None, create_add=None, create_sub=None)
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:
- classmethod link_pitch_type(skip_name_check=False, create_init=None, create_add=None, create_sub=None, create_to_class=None)
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()
Convert the pitch to a PitchClass. :return: 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