View Single Post
Old 01-08-2016, 06:07 AM   #127
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

musicbynumbers, firstly, I added developer mode, so you can see what the actual reaper.defer() cycle period in seconds (and also what get/returns from external state if need).

I think you speak about conditions. That way I`ll need to rewrite caching function code, seems it opens much problems with backwards compatibility.

Now function is looks like
Code:
codestring= 'x^2+0.5'
data.routing[i][k].func = load('local x = ... return '..codestring)
To make conditions work I guess I should rebuild this that way:
Code:
codestring= 'y = x^2+0.5'
data.routing[i][k].func = load('local x = ... '..codestring..'return y')
If I implement second way with compability of first (string check for 'y=' at start of formula, for example), you can do something like this:
Code:
codestring= 
 'if x>=0 and x<0.5 then y = x*0.5 else y = x*2-0.5 end'
mpl is offline   Reply With Quote