[docs]classTwoPitchesToCommonHarmonicTuple(core_converters.abc.Converter):"""Find the common harmonics between two pitches. :param tonality: ``True`` for finding common harmonics, ``False`` for finding common subharmonics and ``None`` for finding common pitches between the harmonics of the first pitch and the subharmonics of the second pitch. :type tonality: typing.Optional[bool] :param lowest_partial: The lowest partial to get investigated. Shouldn't be smaller than 1. :type lowest_partial: int :param highest_partial: The highest partial to get investigated. Shouldn't be bigger than 1. :type highest_partial: int """def__init__(self,tonality:typing.Optional[bool],lowest_partial:int,highest_partial:int):self._tonality_per_pitch_tuple=((tonality,tonality)iftonalityisnotNoneelse(True,False))self._tonality_to_partial_tuple_dict={tonality:TwoPitchesToCommonHarmonicTuple._make_partials(lowest_partial,highest_partial,tonality)fortonalityin(True,False)}@staticmethoddef_make_partials(lowest_partial:int,highest_partial:int,tonality:bool)->tuple[tuple[int,music_parameters.JustIntonationPitch],...]:partial_tuple=tuple((nth_partial,music_parameters.JustIntonationPitch(nth_partial,1))fornth_partialinrange(lowest_partial,highest_partial))ifnottonality:[partial.inverse()for_,partialinpartial_tuple]returnpartial_tuple