i just want to get a sin function with the simple math operators? or maybe with the FM operator.
i aint no math genius, but i think it might be possible.
Any way to get Sin or other math function?
You could use polynomial approximation, like taylor series :
sin(x) = x - x^3/3! + x^5/5! - x^7/7! + x^9/9! - ...................................
You could optimize the coefficients with the Remez/Remes exchange algorithm - you will then get :
sin((pi/2)*x) = 1.5707963268 * x - 0.6459640619 * x^3 + 0.0796915849 * x^5 - 0.0046768800 * x^7 + 0.0001530302 * x^9
Remeber that x have the following range [-1 ; 1]
Or
Use the "fx LFO" module with the following parameters :
f = 0
Sel = 0
Gain = Max (2147483647)
WF = 1
RC = 3
RC = 3
P1 = Variable [-2147483647 ; 2147483647]
P2 = Same as the above
P1 = x, out1 = sin(x)
I used the above for the calculation of the width parameter in my reverbs.
Cheers
sin(x) = x - x^3/3! + x^5/5! - x^7/7! + x^9/9! - ...................................
You could optimize the coefficients with the Remez/Remes exchange algorithm - you will then get :
sin((pi/2)*x) = 1.5707963268 * x - 0.6459640619 * x^3 + 0.0796915849 * x^5 - 0.0046768800 * x^7 + 0.0001530302 * x^9
Remeber that x have the following range [-1 ; 1]
Or
Use the "fx LFO" module with the following parameters :
f = 0
Sel = 0
Gain = Max (2147483647)
WF = 1
RC = 3
RC = 3
P1 = Variable [-2147483647 ; 2147483647]
P2 = Same as the above
P1 = x, out1 = sin(x)
I used the above for the calculation of the width parameter in my reverbs.
Cheers
well that idea didnt work. i need to be able to input the signal i want to do the math on in realtime, and that only works with async.
yes a lookup table would be a great atom, as would "opamp", "resistor" and "capacitor" to go with "diode"
when im feeling a bit smarter maybe ill try that polynomial approximation. but i think it would be a mess.
yes a lookup table would be a great atom, as would "opamp", "resistor" and "capacitor" to go with "diode"
when im feeling a bit smarter maybe ill try that polynomial approximation. but i think it would be a mess.
Well it updates for every 14 samples.Neutron wrote:well that idea didnt work. i need to be able to input the signal i want to do the math on in realtime, and that only works with async.
If you need sample based calculation then polynomial approximation is the right solution.
Someone is apparently lazy, eh?Neutron wrote:when im feeling a bit smarter maybe ill try that polynomial approximation. but i think it would be a mess.
Here's an example of a polynomial approximation : www.relab.dk/Sin.rar
I dont know what you need it for or the range of the parameters. Try connect the module to the Raw Tri osc and see the behaviour of the module.
Cheers