Exemplo n.º 1
0
def makeRhodes(length, beat, freqs, maxbend=0.05):
    backup = Sampler(snds.load('tones/nycrhodes01.wav'), tune.ntf('c'), direction='fw-bw-loop', tails=False)
    chord = [ keys.rhodes(length, freq, dsp.rand(0.4, 0.7)) for freq in freqs ]
    chord = dsp.randshuffle(chord)
    chord = [ dsp.mix([ dsp.env(fx.penv(backup.play(freq * 2**dsp.randint(0,2), length, dsp.rand(0.4, 0.6))), 'line'), c ]) for freq, c in zip(freqs, chord) ]
    pause = 0
    for i, c in enumerate(chord):
        pause = pause + (dsp.randint(1, 4) * beat)
        c = dsp.pan(c, dsp.rand())
        c = fx.bend(c, [ dsp.rand() for _ in range(dsp.randint(5, 10)) ], dsp.rand(0, maxbend))
        chord[i] = dsp.pad(dsp.fill(c, length - pause), pause, 0)

    return dsp.mix(chord)
Exemplo n.º 2
0
def makeArps(length, beat, cname):
    freqs = tune.chord(cname, key, dsp.randint(1,4))
    tone = Sampler(snds.load('tones/nick.wav'), direction='fw-bw-loop', tails=False)
    freqs = dsp.randshuffle(freqs)

    beat = int((beat * 2) / dsp.randchoose([0.5, 1, 2, 3, 1.5]))

    numbeats = length / beat

    out = ''

    for i in range(numbeats):
        out += tone.play(freqs[i % len(freqs)], beat) 

    out = dsp.fill(out, length)
    out = fx.penv(out)

    return out
Exemplo n.º 3
0
def play(ctl):
    pianos = ['sawvib', 'piano', 'pianooct1', 'harp', 'saw']
    pianos = ['sawvib', 'piano']
    piano = snds.load('genie/%s.wav' % dsp.randchoose(pianos))
    notes = [1,3,5]
    chord = tune.fromdegrees([ dsp.randchoose(notes) + (dsp.randchoose([0, 1]) * 8) for _ in range(dsp.randint(1, 3)) ], octave=0)
    length = dsp.stf(dsp.rand(1, 4))

    layers = []

    for freq in chord:
        p = dsp.transpose(piano, freq / 220.0)
        p = dsp.amp(p, 0.35)
        #p = dsp.pan(p, dsp.rand())
        p = dsp.fill(p, length)

        if dsp.rand() > 0.25:
            p = dsp.vsplit(p, dsp.mstf(100), dsp.mstf(500))
            p = [ dsp.pan(pp, dsp.rand()) for pp in p ]
            p = [ dsp.amp(pp, dsp.rand(0,2)) for pp in p ]
            p = [ dsp.transpose(pp, dsp.randchoose([1,2,4,8])) for pp in p ]
            p = [ dsp.taper(pp, 20) for pp in p ]
            p = [ dsp.pad(pp, 0, dsp.mstf(dsp.rand(0, 100))) for pp in p ]
            p = dsp.randshuffle(p)
            p = ''.join(p)

        if dsp.rand() > 0.75:
            p = dsp.alias(p)

        #p = dsp.env(p, 'phasor')

        layers += [ p ]

    out = dsp.mix(layers)

    return out
Exemplo n.º 4
0
from pippi import dsp
from hcj import snds

kick = snds.load('mc303/kick1.wav')
bigkick = snds.load('mc303/kick2.wav')
#bigkick = dsp.read('snds/kick606.wav').data


def make(length, i):
    return dsp.taper(dsp.fill(dsp.mix([bigkick, kick]), length, silence=True),
                     40)
Exemplo n.º 5
0
from hcj import fx, keys, snds, drums, Sampler
import ctl

dloop2 = dsp.read('samples/jess/loop2.wav').data

dloop1 = dsp.read('samples/jess/loop1.wav').data
dloop1 = dsp.fill(dloop1, dsp.flen(dloop2))

kicksoft = dsp.read('samples/jess/kickshuffle.wav').data
kickhard = dsp.read('samples/jess/kickcym.wav').data
rimshot = dsp.read('samples/jess/rimshot.wav').data
rimshot = dsp.amp(rimshot, 4)

snare = dsp.read('samples/jess/snare.wav').data
snare = dsp.amp(snare, 3)
snare2 = snds.load('hits/hisnarespa.wav')
snare2 = dsp.amp(snare2, 0.25)

clap = snds.load('hits/tapeclap.wav')
clap = dsp.amp(clap, 0.25)

flam = dsp.read('samples/jess/snareflam.wav').data
flam = dsp.amp(flam, 3)
smash = dsp.read('samples/jess/smash.wav').data
skitter = dsp.read('samples/jess/skitter.wav').data
paper = snds.load('hits/papersnap.wav')
sock = snds.load('hits/detroitkick1.wav')
hat = snds.load('hits/keyshihat.wav')

section_choices = {
    'intro': (['intro'] * 4) + (['stasis'] * 1),
Exemplo n.º 6
0
from pippi import dsp
from hcj import snds, fx

hat = snds.load('mc303/hat2.wav')


def make(length, i):
    #h = dsp.bln(length / 4, dsp.rand(6000, 8000), dsp.rand(9000, 16000))
    #h = dsp.amp(h, dsp.rand(0.5, 1))
    #h = dsp.env(h, 'phasor')
    h = hat
    h = dsp.fill(h, length, silence=True)
    if dsp.rand() > 0.5:
        h = fx.penv(h)

    return h
Exemplo n.º 7
0
from pippi import dsp, tune
from hcj import snds

guitar = snds.load('hcj/guitar1.wav')
guitar = dsp.transpose(guitar, 0.711)  # transpose from Db to G


def makeScale():
    scale = dsp.rotate([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], vary=True)
    if dsp.rand() > 0.5:
        scale.reverse()

    for _ in range(4, 8):
        scale.pop(dsp.randint(0, len(scale) - 1))

    return scale


def getRatio(degree, ratios=tune.terry, scale=tune.major):
    ratio = ratios[scale[(degree - 1) % len(scale)]]
    return ratio[0] / ratio[1]


def make(length, i):
    r = dsp.transpose(guitar, getRatio(scale[i % len(scale)]))
    r = dsp.mix([
        dsp.pan(r, dsp.rand()),
        dsp.drift(dsp.pan(r, dsp.rand()), dsp.rand(0.001, 0.02))
    ])

    if dsp.rand() > 0.5:
Exemplo n.º 8
0
from pippi import dsp, tune
from hcj import snds, keys

key = 'g'

rhodes = snds.load('hcj/rhodes1.wav')
rhodes = dsp.transpose(rhodes, 16.0/15.0)

def chord(length, freqs, amp):
    layers = [ keys.rhodes(length, freq, amp * dsp.rand(0.25, 0.5)) for freq in freqs ]
    layers = [ dsp.pan(layer, dsp.rand()) for layer in layers ]

    return dsp.mix(layers)

def makeStab(length, i):
    freqs = tune.fromdegrees([ dsp.randchoose([1,2,3,4,5,6,8]) for _ in range(dsp.randint(2,4)) ], octave=3, root=key)
    stab = chord(length, freqs, dsp.rand(0.25, 0.75))
    stab = dsp.taper(stab, 40)
    stab = dsp.fill(stab, length, silence=True)

    return stab

def makePulse(length, i):
    freqs = tune.fromdegrees([ dsp.randchoose([1,2,3,4,5,6,8]) for _ in range(dsp.randint(2,4)) ], octave=2, root=key)
    pulse = chord(length, freqs, dsp.rand(0.5, 0.75)) 
    pulse = dsp.taper(pulse, 40)
    pulse = dsp.amp(pulse, dsp.rand(0.5, 1))
    pulse = dsp.fill(pulse, length, silence=True)

    return pulse
Exemplo n.º 9
0
from pippi import dsp, tune
from hcj import snds

guitar = snds.load('hcj/guitar1.wav')
guitar = dsp.transpose(guitar, 0.711) # transpose from Db to G

def makeScale():
    scale = dsp.rotate([1,2,3,4,5,6,7,8,9,10], vary=True)
    if dsp.rand() > 0.5:
        scale.reverse()

    for _ in range(4, 8):
        scale.pop(dsp.randint(0, len(scale)-1))

    return scale

def getRatio(degree, ratios=tune.terry, scale=tune.major):
    ratio = ratios[scale[(degree - 1) % len(scale)]]
    return ratio[0] / ratio[1]

def make(length, i):
    r = dsp.transpose(guitar, getRatio(scale[ i % len(scale)]))
    r = dsp.mix([ dsp.pan(r, dsp.rand()), dsp.drift(dsp.pan(r, dsp.rand()), dsp.rand(0.001, 0.02)) ])

    if dsp.rand() > 0.5:
        r = dsp.alias(r)

    if dsp.rand() > 0.5:
        r = dsp.split(r, dsp.flen(r) / dsp.randint(2,5))
        r = dsp.randshuffle(r)
        r = ''.join(r)
Exemplo n.º 10
0
from pippi import dsp
from hcj import snds

snare = snds.load('mc303/snare1.wav')
snare = dsp.amp(snare, 3)
#snare = dsp.read('snds/snare.wav').data
#snare = dsp.env(snare, 'phasor')
snarex = dsp.split(snare, 0, 1)


def make(length, i):
    #burst = dsp.bln(length, dsp.rand(400, 800), dsp.rand(8000, 10000))
    #burst = dsp.env(burst, 'phasor')
    #s = dsp.mix([snare, burst])
    s = snare
    s = dsp.transpose(s, dsp.rand(0.9, 1.1))

    s = dsp.fill(s, length, silence=True)

    return dsp.taper(s, 40)
Exemplo n.º 11
0
from pippi import dsp
from hcj import snds

snare = snds.load("mc303/snare1.wav")
snare = dsp.amp(snare, 3)
# snare = dsp.read('snds/snare.wav').data
# snare = dsp.env(snare, 'phasor')
snarex = dsp.split(snare, 0, 1)


def make(length, i):
    # burst = dsp.bln(length, dsp.rand(400, 800), dsp.rand(8000, 10000))
    # burst = dsp.env(burst, 'phasor')
    # s = dsp.mix([snare, burst])
    s = snare
    s = dsp.transpose(s, dsp.rand(0.9, 1.1))

    s = dsp.fill(s, length, silence=True)

    return dsp.taper(s, 40)
Exemplo n.º 12
0
from pippi import dsp, tune
from hcj import snds, keys

key = 'g'

rhodes = snds.load('hcj/rhodes1.wav')
rhodes = dsp.transpose(rhodes, 16.0 / 15.0)


def chord(length, freqs, amp):
    layers = [
        keys.rhodes(length, freq, amp * dsp.rand(0.25, 0.5)) for freq in freqs
    ]
    layers = [dsp.pan(layer, dsp.rand()) for layer in layers]

    return dsp.mix(layers)


def makeStab(length, i):
    freqs = tune.fromdegrees([
        dsp.randchoose([1, 2, 3, 4, 5, 6, 8]) for _ in range(dsp.randint(2, 4))
    ],
                             octave=3,
                             root=key)
    stab = chord(length, freqs, dsp.rand(0.25, 0.75))
    stab = dsp.taper(stab, 40)
    stab = dsp.fill(stab, length, silence=True)

    return stab

Exemplo n.º 13
0
from pippi import dsp
from hcj import snds, fx

hat = snds.load('mc303/hat2.wav')

def make(length, i):
    #h = dsp.bln(length / 4, dsp.rand(6000, 8000), dsp.rand(9000, 16000))
    #h = dsp.amp(h, dsp.rand(0.5, 1))
    #h = dsp.env(h, 'phasor')
    h = hat
    h = dsp.fill(h, length, silence=True)
    if dsp.rand() > 0.5:
        h = fx.penv(h)

    return h


Exemplo n.º 14
0
from pippi import dsp
from hcj import snds

kick = snds.load('mc303/kick1.wav')
bigkick = snds.load('mc303/kick2.wav')
#bigkick = dsp.read('snds/kick606.wav').data

def make(length, i):
    return dsp.taper(dsp.fill(dsp.mix([ bigkick, kick ]), length, silence=True), 40)