Hey y’all.
I thought that Pgauss
would be the opposite of Pmeanrand
.
I am surprised that Pgauss
yields negative values in the below example:
(
SynthDef(\saw, {
arg dur, atk = 0.01, rel = 1.0,
t_gate = 1, out, freq = 442, lpf = 5500,
rq = 1, pan = 0.0, amp = 0.5;
var env = EnvGen.kr(Env.perc(atk, rel), t_gate, timeScale: dur, doneAction: 2);
var sig = Saw.ar(freq: freq, mul: env);
sig = RLPF.ar(sig, lpf.clip(20.0, 20000.0), rq.clip(0.0,1.0));
sig = Pan2.ar(sig, pan);
Out.ar(out, sig * amp);
}).add;
)
(
Pdef(0,
Pbind(*[
instrument: \saw,
rps: Phprand(5, 11),
freq: 100 * Pstutter(Pkey(\rps), Plprand(1, 9)),
lpf: Pkey(\freq).expexp(100, 900, 800, 1600),
dur: 1 / Pstutter(Pkey(\rps), Phprand(5, 11)),
amp: Pgauss(0.5, 0.5).trace,
rel: Phprand(9.0, 13.0),
pan: Pmeanrand(-1.0, 1.0),
])
).play
)
If Pgauss
is behaving as intended let me move on to my actual question. What is the opposite of Pmeanrand
?
What I, as a user would like to do is this:
Pbellcurve(0.0, 1.0)
<–[Fantasy Pattern object]
and for that to yield values from 0.0 to 1.0 where 0.5 is most likely to occur.
Any help greatly appreciated.