pitchtypes.enharmonic.Enharmonic

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

Bases: AbstractBase

__init__(value, is_pitch, is_class, **kwargs)

Methods

__init__(value, is_pitch, is_class, **kwargs)

compare(other)

Comparison between two enharmonic types.

convert_to(other_type)

convert_to_logfreq()

create_subtypes()

embed()

from_semitones(semitones)

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(*args, **kwargs)

name_check(cls, sub_type, suffix, ...)

Check if sub_type follows the standard naming convention.

octaves()

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])

set_func_attr(sub_type, flags, names, funcs)

Add functions funcs as methods with names to class sub_type, controlled by flags.

Interval

alias of EnharmonicInterval

IntervalClass

alias of EnharmonicIntervalClass

Pitch

alias of EnharmonicPitch

PitchClass

alias of EnharmonicPitchClass

__eq__(other)

Return self==value.

__ge__(other, NotImplemented=NotImplemented)

Return a >= b. Computed by @total_ordering from (not a < b).

__gt__(other, NotImplemented=NotImplemented)

Return a > b. Computed by @total_ordering from (not a < b) and (a != b).

__hash__ = None
__le__(other, NotImplemented=NotImplemented)

Return a <= b. Computed by @total_ordering from (a < b) or (a == b).

__lt__(other)

Return self<value.

__repr__()

Return repr(self).

__setattr__(key, value)

Implement setattr(self, name, value).

__str__()

Return str(self).

__weakref__

list of weak references to the object (if defined)

compare(other)

Comparison between two enharmonic types.

Returns 0 if the objects are equal, 1 if the first object (self) is greater, and -1 if the second object (other) is greater.

This method can be indirectly used through binary comparison operators (including ==, < etc.).

Parameters:

other – an object to compare to (same type as self)

Returns:

-1 / 0 / 1 (integer)

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