Help Generating an S-Curve/Sigmoid?

Hallo -
I am hoping to make a conventional “double s-curve”/sigmoid, like the attached image , but I’m finding it difficult to tune in correctly. Can anyone suggest an object to do this with?
640px-Logistic-curve.svg

One way is to use Env:

Env([0, 1], [1], curve: 'sine').plot;

Best,
Paul

Thank you! Is there a way to adjust the curvature on either end?

Yes using numbers for curve instead of sine. For s-shaped, 2 stages are needed:

Env([0, 0.5, 1], [1,1], curve: [-2, 2]).plot;
Env([0, 0.5, 1], [1,1], curve: [-4, 4]).plot;
Env([0, 0.5, 1], [1,1], curve: [-8, 8]).plot;
1 Like

this gives you a stateless sigmoid function with adjustable curve:

(
var scurve = { |phase, curve|
	var phaseScaled = phase.linlin(0, 1, -1, 1);
	var v1 = phaseScaled - (curve * phaseScaled);
	var v2 = curve - (2 * curve * phaseScaled.abs) + 1;
    v1 / v2;
};

{
	var phase = Sweep.ar;
	scurve.(phase, \curve.kr(0.8));
}.plot(1);
)

curve = 0.8
grafik

curve = -0.8
grafik

1 Like