示例#1
0
文件: haiku.py 项目: hecanjog/fabric
    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) ])
示例#2
0
def delay(length):
    """ Length in frames """
    
    duration = dsp.fts(length)
    start = monotonic()

    while monotonic() < start + duration:
        pass
示例#3
0
def delay(length):
    """ Length in frames """

    duration = dsp.fts(length)
    start = monotonic()

    while monotonic() < start + duration:
        pass