Testing a new sequencer for astrid. The pauses sound cool, but they are likely deadlocks. :-p
from pippi import dsp, oscs, shapes, fx, tune
import astrid
def play(ctx):
steps = [
[1,4,6,9],
[3,5,7,8],
[4,6,7,10],
]
steps = steps[ctx.count//3 % len(steps)]
freqs = tune.degrees(steps, octave=3, key='a')
freq = dsp.choice(freqs)
length = dsp.rand(0.015, dsp.rand(.25, dsp.rand(0.5,1)))
length = 1.5
ws = dsp.ws(ctx.adc(0.1), limit=dsp.randint(10,30))
out = oscs.Pulsar2d(ws,
pulsewidth=shapes.win('sine', dsp.rand(0, 0.9), 1, length=dsp.rand(0.1,dsp.rand(0.2,dsp.rand(2,20)))),
freq=freq * 2**dsp.randint(-2,2) + dsp.rand()
).play(length)
out = out.taper(0.005).pan(dsp.rand())
out = fx.lpf(out, dsp.rand(50,10000))
out = fx.fold(out, dsp.rand(1,5))
out = fx.norm(out, dsp.rand(0.2, 0.25))
return out.env('pluckout')
def seq(ctx):
length = 3
beat = 0.25
onsets1 = dsp.pat2onsets('xxxx.', beat, beats=32)
onsets2 = dsp.pat2onsets('xxxx.', beat, beats=32)
ctx.seq.set(0, length, onsets=onsets1)
ctx.seq.set(1, length, onsets=onsets2)
ctx.seq.set(2, length, onsets=onsets1)
ctx.seq.set(3, length, onsets=onsets2)
if __name__ == '__main__':
astrid.run_forever(__file__)