freqs = tune.fromdegrees([dsp.randint(1, 9) for _ in range(nlayers)], octave=1, root='a') for i, freq in enumerate(freqs): layers[i] = dsp.pine(layer, dsp.flen(layer) * 10, freq) section = dsp.fill(dsp.mix(layers), sectionlength) plen = dsp.randint(16, 32) pattern = dsp.eu(plen, dsp.randint(4, plen)) pattern = ['x' if h == 1 else '.' for h in pattern] beat = dsp.flen(section) / plen kicks = ctl.makeBeat(pattern, [beat for _ in range(plen)], makeKick) pattern = 'x..' rimshots = ctl.makeBeat(pattern, [dsp.flen(section) / 16 for _ in range(16)], makeRimshot) pattern = ctl.parseBeat('xxxx') pdiv = dsp.randint(32, 64) hats = ctl.makeBeat(pattern, [dsp.flen(section) / pdiv for _ in range(pdiv)], orc.hat.make) out += dsp.mix([hats, rimshots, kicks, section]) dsp.write(out, '04-bumps_i')
layers += [ swells ] if canPlay('rushes', section): rushes = [ drums.roll(dsp.randchoose([paper, smash, snare, rimshot, kickhard]), bar_length, dsp.randint(1, 3)) for _ in range(3) ] layers += [ dsp.amp(dsp.mix(rushes), 0.5)] if canPlay('snares', section): snarep = '....x...' if elapsed > dsp.stf(90) and dsp.rand() > 0.75: snarep = '....xx..' if elapsed > dsp.stf(120) and dsp.rand() > 0.75: snarep = '..x..x..x' pattern = ctl.parseBeat(snarep) snares = ctl.makeBeat(pattern, [ beat for _ in range(numbeats) ], makeSnare) snares = dsp.amp(snares, dsp.rand(2,4)) snares = dsp.fill(snares, bar_length) layers += [ snares ] if canPlay('hats', section): hatp = 'x.x.' pattern = ctl.parseBeat(hatp) hats = ctl.makeBeat(pattern, [ beat for _ in range(numbeats) ], makeHat) if section == 'float': hats = fx.penv(hats) layers += [ hats ]
p = dsp.amp(p, amp) p = dsp.pan(p, pan) layer += p layers += [ layer ] freqs = tune.fromdegrees([dsp.randint(1, 9) for _ in range(nlayers)], octave=1, root='a') for i, freq in enumerate(freqs): layers[i] = dsp.pine(layer, dsp.flen(layer) * 10, freq) section = dsp.fill(dsp.mix(layers), sectionlength) plen = dsp.randint(16, 32) pattern = dsp.eu(plen, dsp.randint(4, plen)) pattern = [ 'x' if h == 1 else '.' for h in pattern ] beat = dsp.flen(section) / plen kicks = ctl.makeBeat(pattern, [ beat for _ in range(plen) ], makeKick) pattern = 'x..' rimshots = ctl.makeBeat(pattern, [ dsp.flen(section) / 16 for _ in range(16) ], makeRimshot) pattern = ctl.parseBeat('xxxx') pdiv = dsp.randint(32, 64) hats = ctl.makeBeat(pattern, [ dsp.flen(section) / pdiv for _ in range(pdiv) ], orc.hat.make) out += dsp.mix([ hats, rimshots, kicks, section ]) dsp.write(out, '04-bumps_i')
suiteguitarprob = dsp.breakpoint([ dsp.rand() for _ in range(8) ], 15) + [ 0 for _ in range(nsegs - 30) ] + dsp.breakpoint([ dsp.rand() for _ in range(8) ], 15) stabprob = [ 0 for _ in range(3) ] + dsp.breakpoint([ dsp.rand() for _ in range(8) ], nsegs - 6) + [ 0 for _ in range(3) ] pulseprob = [ 0 for _ in range(3) ] + dsp.breakpoint([ dsp.rand() for _ in range(8) ], nsegs - 6) + [ 0 for _ in range(3) ] longchordprob = [ 1 for _ in range(3) ] + dsp.breakpoint([ dsp.rand() for _ in range(8) ], nsegs - 6) + [ 1 for _ in range(3) ] guitarprob = [ 1 for _ in range(nsegs) ] glitchprob = [ 1 for _ in range(3) ] + dsp.breakpoint([ dsp.rand() for _ in range(8) ], nsegs - 6) + [ 1 for _ in range(3) ] wesprob = dsp.breakpoint([ dsp.rand() for _ in range(8) ], nsegs) for segi, seg in enumerate(segs): print 'Rendering section %s' % (segi + 1) layers = [] if dsp.rand() < kickprob[segi]: kickp = 'x...-.....x..x...' pattern = ctl.parseBeat(kickp) kicks = ctl.makeBeat(pattern, seg, orc.kick.make) layers += [ kicks ] if dsp.rand() < snareprob[segi]: snarep = '..x...x...' pattern = ctl.parseBeat(snarep) subseg = ctl.splitSeg(seg, 2) snares = ctl.makeBeat(pattern, subseg, orc.snare.make) layers += [ snares ] if dsp.rand() < hatprob[segi]: hatp = 'xxxx' pattern = ctl.parseBeat(hatp)
[dsp.rand() for _ in range(8)], nsegs - 6) + [0 for _ in range(3)] longchordprob = [1 for _ in range(3)] + dsp.breakpoint( [dsp.rand() for _ in range(8)], nsegs - 6) + [1 for _ in range(3)] guitarprob = [1 for _ in range(nsegs)] glitchprob = [1 for _ in range(3)] + dsp.breakpoint( [dsp.rand() for _ in range(8)], nsegs - 6) + [1 for _ in range(3)] wesprob = dsp.breakpoint([dsp.rand() for _ in range(8)], nsegs) for segi, seg in enumerate(segs): print 'Rendering section %s' % (segi + 1) layers = [] if dsp.rand() < kickprob[segi]: kickp = 'x...-.....x..x...' pattern = ctl.parseBeat(kickp) kicks = ctl.makeBeat(pattern, seg, orc.kick.make) layers += [kicks] if dsp.rand() < snareprob[segi]: snarep = '..x...x...' pattern = ctl.parseBeat(snarep) subseg = ctl.splitSeg(seg, 2) snares = ctl.makeBeat(pattern, subseg, orc.snare.make) layers += [snares] if dsp.rand() < hatprob[segi]: hatp = 'xxxx' pattern = ctl.parseBeat(hatp)