Korg Forums Forum Index Korg Forums
A forum for Korg product users and musicians around the world.
Moderated Independently.
Owned by Irish Acts Recording Studio & hosted by KORG USA
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

I need a mathematician for a coming tutorial

 
Post new topic   Reply to topic    Korg Forums Forum Index -> Korg Kronos
View previous topic :: View next topic  
Author Message
CharlesFerraro
Platinum Member


Joined: 06 Feb 2010
Posts: 955
Location: California

PostPosted: Sun Jun 04, 2017 7:43 pm    Post subject: I need a mathematician for a coming tutorial Reply with quote

As far as I know... it's very very difficult to derive a function from a set of plot points since a veritable infinite number of functions can be used to describe any set.
...but isn't it possible to get very close to a workable function that can extrapolate values on a curve?

As you can tell I'm not a mathematician. Here's the nitty gritty of what I need:



I need to know exact Hz values for the LFO's for an interesting sound design idea. The above functions on some exponential curve but I simply have no idea how to find the derivative. I've heard Excel can help but I don't own or know how to use that program. Any help would be appreciated.



There's a rough plot so you can see that it is exponential. Still, since I never went to school for this stuff I simply have no idea how to go about interpolating between plot points or what have you.
_________________
paypal.me/CharlesFerraro


Last edited by CharlesFerraro on Mon Jun 05, 2017 5:35 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
bmtg



Joined: 22 May 2017
Posts: 37

PostPosted: Sun Jun 04, 2017 10:49 pm    Post subject: Reply with quote

Can you fill in a few more values between 90 and 99? It doesn't look quite exponential but a fitting function could be found. Most of the curvature happens between 90 and 99 so more values there would help the fit.
_________________
Kronos 2.73 - NanoPad2 - MBP - DP9


Last edited by bmtg on Mon Jun 05, 2017 2:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
Koekepan
Platinum Member


Joined: 27 Sep 2016
Posts: 617

PostPosted: Mon Jun 05, 2017 3:01 am    Post subject: Reply with quote

(Disclaimer: been a long time since I studied mathematics with any focus.) It's actually not all that hard.

So, if you're talking exponential, your basic formula is y = C * (a ^ x)

That means that your Frequency is a function of some value raised to the Frequency Value power, multiplied by constant C.

As it turns out, it's easy to find out what C is, because (anything ^ 0 )= 1. We know that C(a^0)=0.014, so your constant is 0.014.

Assuming you genuinely have an exponential curve on your hands, it shouldn't be too hard.
Back to top
View user's profile Send private message
tim.condon



Joined: 15 Sep 2015
Posts: 22

PostPosted: Mon Jun 05, 2017 7:19 am    Post subject: Reply with quote

The technical name for what you're after is "curve fitting" or (non-linear) "regression analysis."

Give this free web tool a try: https://mycurvefit.com/

You can explore different models by selecting from the "fit method" box.
Back to top
View user's profile Send private message
CharlesFerraro
Platinum Member


Joined: 06 Feb 2010
Posts: 955
Location: California

PostPosted: Mon Jun 05, 2017 4:48 pm    Post subject: Reply with quote

Tim, WOW! The predictive power of that tool was very accurate! Turns out the algorithm to help calculate points is the "Akima Cubic Spline". I entered in all known values save the first and last to test the predictive power of each algorithm and that one turned out best. Even if it was still off, the curve is graphed through each coordinate as it should be and I think will be very accurate for calculating intermediate values (when all plot points are entered) but not so much so for frequency values boosted by AMS. However at that point you can tune the rate of the LFO by ear since you're well into audible range after 32Hz.

The site regulates users to 50 calculations and you can't enter more than 6 at a time. I used a heck of a lot testing each algorithm so I'm down to 5 predictions or so that I'm going to use for that future patch. Otherwise I would post the LFO rates of all frequency values.

However even if I were to do that... I still wouldn't know exact values for frequency fine, even if the algorithm were perfect. Because frequency fine gives "98 additional steps for each step of the main Frequency parameter." In other words frequency fine is not base 100, but rather base 99. So let's say I asked the curve to predict what my Hz value would be for a frequency value of 50 and a frequency fine value of 99... I couldn't type 50.99 as my X because freq50+fine99 is de facto 51. But using a decimal point value to stand in for frequency fine is as close as you're going to get.
_________________
paypal.me/CharlesFerraro
Back to top
View user's profile Send private message Send e-mail MSN Messenger
bmtg



Joined: 22 May 2017
Posts: 37

PostPosted: Mon Jun 05, 2017 7:51 pm    Post subject: Reply with quote

Charles,
As a rule, spline curves are always an exact match at the given data points, and there is interpolation in between. It may be your best option in this case, but it depends how "exact" you need the outputs.

I looked at the data for a bit, and it seems that the function used is some sort of compound function. In the range of values 0 thru 90, it matches pretty well a formula that is freq = C * value^P + 0.014. Where C = 2.0931 and P = 0.000779651. But this breaks down for 99 and 99f99 points, they are generated by a different function. Without seeing additional data between 90 and 99, it's really hard to say what form the function would take up there.

For the fine, if the 98 points are linear, then you could just multiply the fine number by 100/99 to get the equivalent decimal value.

Cheers
_________________
Kronos 2.73 - NanoPad2 - MBP - DP9
Back to top
View user's profile Send private message
Mike Conway
Approved Merchant
Approved Merchant


Joined: 28 Jan 2005
Posts: 2433
Location: Las Vegas, Nevada

PostPosted: Tue Jun 06, 2017 6:42 am    Post subject: Reply with quote

I know where I'm coming for next year's taxes. You guys may help me avert a spline injury. Laughing

This thread reminds me a little of when I had to convert DX7 parameters to SY77/99 values, years ago.
Back to top
View user's profile Send private message Visit poster's website
CharlesFerraro
Platinum Member


Joined: 06 Feb 2010
Posts: 955
Location: California

PostPosted: Sun Jul 30, 2017 3:54 pm    Post subject: Reply with quote

If anyone is interested, I did end up finding exact values for the LFO time and Fine parameters, as well as some accurate readings for a few LFO times boosted by an AMS. That information can be found here: http://www.korgforums.com/forum/phpBB2/viewtopic.php?t=110943
bmtg wrote:
For the fine, if the 98 points are linear, then you could just multiply the fine number by 100/99 to get the equivalent decimal value.

Cheers

You were exactly correct, bmtg.

I also did end up making that patch. The reason I needed exact times was because I needed the LFO's to have MIDI sync off in order to modulate their frequency... but then I needed the LFO's to be locked in rate to each other. I could've chosen any arbitrary tempo but I decided on 110bpm. That patch is shown in detail here:

_________________
paypal.me/CharlesFerraro
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Korg Forums Forum Index -> Korg Kronos All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group