It would be so easy if IEnvGen could modulate the envelope.
Just wondering if anyone has done, or plans to do, this?
Without that feature, I have to try to break up the phase into segments and separately apply lincurves to each. It’s… just not working. lincurve is giving me bad values which crash the server. I’ve tried taking apart the math and rebuilding it a bit more optimally and I’m just getting flat values, no moving phase.
Shaper would be another option but it’s also not readily modulatable.
Oh well, check my formulas on paper later I guess. Actually I did find the issue… can’t shake the feeling that this was much harder than it needed to be, though.
Hm, potentially – it turns out that I do only have two variables (a phasor, and a stretch/squeeze factor – an offset is applied after that). Originally I had a curve factor too, but that ended up not sounding good, so I dropped it.
I’m thinking to release a quark with this eventually – I also worked out mipmapping to reduce aliasing somewhat.
One way (unrelated to IEnvGen but might still be useful) is to use phasor ** (2 ** squeezeStretch), where squeezeStretch of zero gives no phase distortion:
(
{
var freq = 130;
var phasor = Phasor.ar(0, freq / SampleRate.ir, 0, 1);
var squeezeStretch = LFTri.ar(0.1, 0, 5, 0); // from -5 to 5
var outPhase = phasor ** (2 ** squeezeStretch);
SinOsc.ar(0, outPhase * 2pi, 0.1);
}.scope;
)
Oh that’s very nice – perhaps (((phasor * 2 - 1) ** (something)) * 0.5 + 0.5) * bufFrames (bipolar eliminates discontinuity in the slope when wrapping back around – though after the fact, I realize this depends on JMc’s funky definition of exponentiation in the server ).