music.pitch_to_freq¶
- music.pitch_to_freq(start_freq=220.0, semitones=(0, 7, 7, 4, 7, 0))[source]¶
Generates a list of frequencies based on a list of semitones and a starting frequency.
This function calculates a list of frequencies based on the given list of semitones and a starting frequency. Each semitone value represents the number of semitones above or below the starting frequency.
- Parameters:
- Returns:
listA list of frequencies calculated from the given semitones and starting frequency.
- Parameters:
- Return type:
Examples
>>> pitch_to_freq(semitones=(0, 7, 12)) # a fifth, then an octave [220.0, 329.6275569128699, 440.0] >>> len(pitch_to_freq()) # the default is (0, 7, 7, 4, 7, 0) 6 >>> pitch_to_freq(start_freq=440, semitones=[0, 12, 12, 12]) [440.0, 880.0, 880.0, 880.0]