def __init__(self, **kwargs): super(WeirdSound, self).__init__(**kwargs) self._lfo_freq_initial = 0.4 self._lfo_freq = pyo.SigTo(value=self._lfo_freq_initial, time=0.5) self.lfo = pyo.Sine(freq=self._lfo_freq, mul=0.001, add=0.001) self.lfo.play() freq = pyo.midiToHz(60) self._freq = pyo.SigTo(value=[freq, freq+(0.01*freq), freq*2, freq*2+(0.01*freq*2)], time=1.) self.synth = pyo.Sine(freq=self._freq, mul=self.lfo) self._pan = pyo.SigTo(value=0.5, time=1.9) self.panner = pyo.Pan(self.synth, outs=2, pan=self._pan)
def note(self, val): self.freq = pyo.midiToHz(val)
def midiRangeToHz(min, max): hz = [] for i in range(min, max+1): hz.append(midiToHz(i)) return hz