1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

reaktor precision work-arounds?

Discussion in 'Building With Reaktor' started by Tun, Oct 12, 2013.

  1. Tun

    Tun NI Product Owner

    Messages:
    224
    i have been working hard trying to build a circular arc curve that will mix nicely into a linear curve.
    i am using an event table that is clipped each end to display/reproduce the curve.

    i started by building the arc, which was no problem. i made my fake circle have a radius of 1 and i used the equation Y=√(R²-T²).
    to get T i simply subtracted X from 1.

    i thought the first thing to try would be to mix the curve with the linear curve (X=Y), but this gives you a sharper bend at one end than the other (as it would), and in my case is unacceptable.

    i tried a few things and in the end came up with the perfect idea. i basically, in theory, made the circle bigger and focussed on the point where the angle of the tangent was at 45 degrees from vertical, which would clip both sides of the "zoom range" and give me a curve that was even at both ends.

    the concept works great and im 90% sure my maths is perfect, but the problem im having is that reaktors precision just cant handle this sort of number.
    i have done some research and have learnt about the limitations of bits e.t.c. and have also seen a few not quite so helpful ideas on work-arounds.

    i was wondering if anybody had any work-arounds i could try? or maybe another suggestion?

    i have uploaded the basic idea of what i am trying to do.
    all the relevant maths is in the "Circular arc zoom" macro (at the deepest level), which consists of an "R" knob, that controls the radius of the circle, and simultaneously zooms into the correct position using the maths controlling the cos(45°).
    the "R" knob should go from 1 (complete quarter circle) to whatever number it takes to get as reasonably close to linear as possible. i understand that this curve can never be completely linear, but i just want it close.

    according to my maths the "numeric (1)" display should always read 1, with only small room for error, but at R=1 the numeric readout is @0.249 and it only levels out at around R=250



    sorry for the long confusing post :/

    any help would be appreciated.

    thank you
     

    Attached Files:

  2. herw

    herw NI Product Owner

    Messages:
    6,421
    mathematical background (pdf-file):
    i think there is a small mistake in your formula; influence of center point isn't correct.
    View attachment curve.pdf
    left side your solution, right side my solution
    curve Bild 1.jpg

    curve Bild 2.jpg

    curve Bild 3.jpg
    and here is the ensemble

    View attachment curve.ens.zip

    ciao herw
     
    Last edited: Oct 12, 2013
  3. herw

    herw NI Product Owner

    Messages:
    6,421
    PS:
    the knob x_m is an exponential knob (means in core i transform to 10^x_m). So x_m=3 means 1000.
    Interesting thing of mathematical exactness of REAKTOR: if you choose near x_m=5 (means 100000), means very big radius, you see the rounding of floating numbers:
    rounding.jpg
     
  4. Tun

    Tun NI Product Owner

    Messages:
    224
    i see!
    i had a feeling that i wasnt specifying my range correctly. i tried a couple of things to correct this but i got stressed and handed it over to the community :)
    as for the steps, i had a feeling that would happen, but i plan to smooth that out after. shouldnt be a problem as the steps become large enough to smooth out pretty easily.

    i had a quick look and made a very small adjustment (because A and B are variables) and it seems to work perfectly!
    i removed the /2000 following the X input and placed the macro where the "circular arc zoom" macro is. A and B are converted from whatever they are set at into 0 and 1 before this point, then converted back after the curve is defined, so this should work nicely.

    i will try it out in my ensemble later and see how it works.

    thanks a lot for your help! i really appreciate it.
     
  5. herw

    herw NI Product Owner

    Messages:
    6,421
    Hope you do not want to use it in an envelope, because normally you calculate it step by step as a change but not as a value of a function because of high CPU usage with audio events. That's not simple for a circle-function.

    ciao herw
     
  6. Tun

    Tun NI Product Owner

    Messages:
    224
    just tried this in my ensemble and i dont think i will really need to smooth those steps. it is for a waveshaper, so i analysed a sine wave through it using an oscilloscope and the EzFFT analyser. there is aliasing of course, but it is only visible once the X_M knob gets to just under 3, and it is audible even less so.

    i think i will use the function as it is, then when it gets to about 2.5 i will mix it into the inversion of the curve (@2.5), then after the inversion goes below 2.5 i will use the inverted curve alone.

    i will end up with the same warped curve i had originally, but only for the 2.5 to 2.5(inv) range, which is pretty much a linear curve anyway. as this curve is more intended for much more obvious shaping i will not be using it at a linear setting anyway, i will have a linear setting for that.
    in fact, what i could do is mix 2.5 to 3 into a linear curve (3 being completely linear), then back into the inversion at 3 to 2.5, and 100% curve function after that.

    thank you very much for your help.
     
  7. Tun

    Tun NI Product Owner

    Messages:
    224
    no, its for a waveshaper. i think you know that now though from my last post :)