def train(self, length, hz): num = int(length / dsp.htf(hz)) print dsp.fts(length), hz amp = self.pop(num) wtables = ['gauss', 'line', 'phasor'] + ['vary' for v in range(12)] width = dsp.wavetable(wtables[int(self.rpop(0, 14))], num, self.rpop(0.0, 2.5), self.rpop(2.5, 5.0), self.rpop) # Not random anymore, yay! pan = self.pop(num) return ''.join([ self.impulse(amp[i], width[i], pan[i], hz) for i in range(num) ])
def delay(length): """ Length in frames """ duration = dsp.fts(length) start = monotonic() while monotonic() < start + duration: pass