PwarpDur (addition to ddwPatterns quark)

In the last day or two, I was exploring rhythm warping – starting in my live coding system, but then I decided to make a standalone pattern out of it.

If you check out or update the ddwPatterns quark, then you’ll have PwarpDur: configurable accelerandi and ritardandi.

(
SynthDef(\buce, { |out, freq = 70, ratio = 4.44, dropTime = 0.07, hold = 0.05, rel = 0.04,
    preamp = 7.94, feedback = 1.37, amp = 0.1, pan = 0|
    var eg = EnvGen.ar(Env([0, 1, 0.7, 0], [0.005, hold, rel], -4), doneAction: 2);
    var freqEg = EnvGen.ar(Env([1, ratio, 1], [0.001, dropTime], \exp));
    var fb = LocalIn.ar(1) * feedback;
    var sig = SinOsc.ar(freq * freqEg, fb % 2pi) * eg;
    sig = (sig * preamp.dbamp).tanh;
    LocalOut.ar(sig);
    sig = Pan2.ar(sig, pan, amp);
    Out.ar(out, sig * amp);
}).add;
)

(
p = Pspawner { |sp|
    var dur;
    var side = Pdup({ rrand(1, 2) }, Pseq([-1, 1], inf, 2.rand)).asStream;
    loop {
        dur = rrand(2.5, 5.0);
        sp.par(Pbind(
            \instrument, \buce,
            \freq, exprand(60, 120),
            \ratio, exprand(4.0, 5.5),
            \dur, dur * PwarpDur(1 / rrand(16, 25), cycleDur: 1, curve: 2.1, midpoint: 1),
            \amp, 0.2,
            \pan, rrand(0.55, 0.9) * side.next
        ));
        sp.wait(dur * exprand(0.4, 0.65));
    }
}.play;
)

p.stop;

“\buce”? … yeah :grin:

hjh

2 Likes

And… fixed one small error (embedInStream should return inval at the end).

hjh