A starting point is to observe that frequency is the derivative of phase. Some basic calculus tutorials online should explain what “derivative” is… but consider. When you produce phase by, for instance, Phasor.ar(0, freq * SampleDur.ir, 0, 1)
, freq * SampleDur.ir
is an increment that is added to the phase every time. So to go from frequency to phase, the operation is integration. A constant frequency integrates to a ramp – picture it in your head; intuitively this makes sense.
The inverse operation of integration is differentiation – slope of the curve. So to get the same effect as a phase formula, but using a frequency input, you differentiate the phase – calculus word is “derivative.”
Mathematicians worked out a lot of formulas already, which you can find online. I haven’t touched calculus since high school, but a quick search finds that the derivative of x ^ 3
is 3x^2 dx
where for our purposes we can disregard the delta notation dx.
2pi · (1 - p) ^ 3
// derivative:
2pi · 3 · (1 - p)^2
6pi · (1 - 2p + p^2)
So if I’ve done the algebraic manipulations right, 6pi * (phase.squared - (2 * phase) + 1)
as a frequency is a starting point.
Unfortunately I can’t test right now, so there may be another times or divide factor, possibly related to sample rate. Also if Squine reads phase as 0 to 1 instead of 0 to 2pi, then 6pi in that formula would have to become 3 instead.
hjh