pysynth/seq.py
def from_freq(cls, freq, middle_pitch=440.0):

        """
        Creates a 'Note' from a given frequency.

        We convert the given frequency 'Note' values
        by determining the number of half steps from the given frequency and the middle pitch,
        and then splitting that value up into separate values.

        :param freq: Frequency in hertz
        :type freq: float
        :param middle_pitch: Middle pitch - Usually A4 or 440.0 hertz
        :type middle_pitch: float
        :return: Note object
        :rtype: Note
        """

        # Convert into number of steps:

        steps = int(log(freq/middle_pitch, 2))

        # Convert into two values and return:

        octv, step = cls.convert(steps)

        return cls(octv, step)

        Creates a 'Note' from a given frequency.

        We convert the given frequency 'Note' values
        by determining the number of half steps from the given frequency and the middle pitch,
        and then splitting that value up into separate values.

        :param freq: Frequency in hertz
        :type freq: float
        :param middle_pitch: Middle pitch - Usually A4 or 440.0 hertz
        :type middle_pitch: float
        :return: Note object
        :rtype: Note
        
Creates a 'Note' from a given frequency.
We convert the given frequency 'Note' values
by determining the number of half steps from the given frequency and the middle pitch,
and then splitting that value up into separate values.
Creates a ' Note ' from a given frequency . We convert the given frequency ' Note ' values by determining the number of half steps from the given frequency and the middle pitch and then splitting that value up into separate values .
def from_freq(cls, freq, middle_pitch=440.0):
        steps = int(log(freq/middle_pitch, 2))
        octv, step = cls.convert(steps)
        return cls(octv, step)
def from_freq ( cls , freq , middle_pitch = 440.0 ) : steps = int ( log ( freq / middle_pitch , 2 ) ) octv , step = cls . convert ( steps ) return cls ( octv , step )
Creates a 'Note' from a given frequency.
Creates a ' Note ' from a given frequency .
"""
        Creates a 'Note' from a given frequency.

        We convert the given frequency 'Note' values
        by determining the number of half steps from the given frequency and the middle pitch,
        and then splitting that value up into separate values.

        :param freq: Frequency in hertz
        :type freq: float
        :param middle_pitch: Middle pitch - Usually A4 or 440.0 hertz
        :type middle_pitch: float
        :return: Note object
        :rtype: Note
        """ # Convert into number of steps: # Convert into two values and return:
None
Note
cls
freq
Frequency in hertz
Frequency in hertz
middle_pitch
Middle pitch - Usually A4 or 440.0 hertz
Middle pitch - Usually A4 or 440 . 0 hertz