Пример #1
0
    def test_svf_bp(self):
        snd = dsp.read('tests/sounds/whitenoise10s.wav')
        freq = [20, 10000]
        res = 0
        out = fx.bpf(snd, freq, res)
        out.write('tests/renders/fx_svf_bp-r0.wav')

        freq = [20, 10000]
        res = 1
        out = fx.bpf(snd, freq, res)
        out.write('tests/renders/fx_svf_bp-r1.wav')
Пример #2
0
    def test_svf_stereo(self):
        snd = dsp.read('tests/sounds/whitenoise10s.wav')
        freql = [20, 10000]
        freqr = [10000, 20]
        res = [0, 1]
        out = fx.bpf(snd, [freql, freqr], res)
        out.write('tests/renders/fx_svf_st-r0.wav')

        freq = [20, 10000]
        resl = "sine"
        resr = "cos"
        out = fx.bpf(snd, freq, [resl, resr])
        out.write('tests/renders/fx_svf_st-r1.wav')
Пример #3
0
    def test_butbp(self):
        snd = dsp.read('tests/sounds/guitar1s.wav')
        freq = 500

        out = fx.bpf(snd, freq)
        out.write('tests/renders/fx_bpf.wav')
Пример #4
0
def drumset(length, pos, total_length):
    print('DRUMSET', length, pos)

    if length < 10:
        div = dsp.choice([2,3,4])
    else:
        div = dsp.choice([4,6,8,12,16])

    beat = length / div
    seg = [ beat for _ in range(div) ]
    layers = []

    maxbeats = dsp.randint(len(seg) / 2, len(seg))
    hatpat = drums.eu(len(seg), maxbeats)

    hats = drums.make(drums.hihat, hatpat, seg) * 0.3
    hats = mixdrift(hats)

    if dsp.rand() > 0.5:
        hats = hats.cloud(length=length, grainlength=1.0/dsp.choice(scale))

    if dsp.rand() > 0.5:
        hats = mixdrift(hats)

    print('MADE HATS')
    layers += [ hats ]

    kpat = drums.eu(len(seg), maxbeats)
    kicks = drums.make(drums.kick, kpat, seg)

    if dsp.randint(0,1) == 1:
        kicks = kicks.cloud(length=length, grainlength=1.0/dsp.choice(scale))
    else:
        kdivs = dsp.randint(2, 4)
        kicks = kicks.cloud(length=length / kdivs, grainlength=(1.0/dsp.choice(scale)) * kdivs)

    if dsp.rand() > 0.5:
        kicks = mixdrift(kicks)

    layers += [ kicks * 0.4 ]

    maxbeats = dsp.randint(2, len(seg) / 2)
    clappat = drums.eu(len(seg), maxbeats)
    claps = drums.make(drums.clap, rotate(clappat, vary=True), seg)

    if dsp.randint(0,1):
        claps = claps.cloud(length=length, grainlength=1.0/dsp.choice(scale))
    else:
        cdivs = dsp.randint(2, 4)
        claps = claps.cloud(length=length / cdivs, grainlength=(dsp.choice(scale)) * cdivs)

    if dsp.rand() > 0.5:
        claps = mixdrift(claps)

    layers += [ claps * 0.4 ]

    drms = fx.softclip(dsp.mix(layers))
    if dsp.rand() > 0.5:
        return fx.lpf(drms, dsp.rand(500, 1000))
    else:
        return fx.bpf(drms, dsp.rand(500, 5000))