def __init__(self, pitch, overtones=[(1, 1, 0)], detune=0): self.freq = pitch_to_frequency(pitch + detune/100.) def nyquist(overtone): return overtone[0] * self.freq < SAMPLING_RATE/2 self.overtones = filter(nyquist, overtones) self._factor = self.freq * 2.0 * np.pi / SAMPLING_RATE Generator.__init__(self)
def __init__(self, pitch, modulator, detune=0): self.modulator = modulator self.freq = pitch_to_frequency(pitch + detune/100.) self._factor = self.freq * 2.0 * np.pi / SAMPLING_RATE Generator.__init__(self)