Slope functions?
- KVRAF
- Topic Starter
- 3062 posts since 10 Nov, 2013 from Germany
Hi,
can someone point me some good hints or links for slope functions?
So, there is a slope parameter (e.g. -1 .. 1) which makes a segment linear (s=0), concave (s=1) or convex (s=-1).
Chris
can someone point me some good hints or links for slope functions?
So, there is a slope parameter (e.g. -1 .. 1) which makes a segment linear (s=0), concave (s=1) or convex (s=-1).
Chris
- KVRist
- 297 posts since 1 Apr, 2009 from Hannover, Germany
Here's a simple one with a parabol segment in the range 0 <= x <= 1:
y = -s x^2 + (1+s)x
However that's not symmetric with respect to the linear version. To get something symmetric you'll probably need to have two versions for positive and negative s, where one would need to include a sqrt. What is this for?
y = -s x^2 + (1+s)x
However that's not symmetric with respect to the linear version. To get something symmetric you'll probably need to have two versions for positive and negative s, where one would need to include a sqrt. What is this for?
- KVRist
- 110 posts since 12 Mar, 2005
If you've normalized values you could do some kind of rational mapping:Chris-S wrote:For purposes like envelope generator and key velocity scaling.
Code: Select all
// m is your value at 0.5
b = (m-0.5)/(0.5-0.5*m);
scaledval = (1+b)*x/(1 + b*x);
EDIT: fixed typo
You do not have the required permissions to view the files attached to this post.
Last edited by stw on Thu Mar 31, 2016 8:33 pm, edited 1 time in total.
-
- Banned
- 12368 posts since 30 Apr, 2002 from i might peeramid
two "cheapies" ... functionality is often inferior for many apps compared to pow/exp style transforms, but "if you can't run them, it doesn't matter.."
inverse "curve" to x*x [0,1]
x*(2-x)
s-curve in same range
x*x*(3-2x)
don't talk about these or ppl will say you're not real dsp
inverse "curve" to x*x [0,1]
x*(2-x)
s-curve in same range
x*x*(3-2x)
don't talk about these or ppl will say you're not real dsp
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
- KVRist
- 297 posts since 1 Apr, 2009 from Hannover, Germany
That's the same as mine (without the parameter), but unfortunately, it's not at all inverse. Should work fine for most cases though, as long as there aren't any constraints to the derivative at the 0,1 points.xoxos wrote: inverse "curve" to x*x [0,1]
x*(2-x)
- KVRAF
- Topic Starter
- 3062 posts since 10 Nov, 2013 from Germany
Wrote a JS plugin which uses the slope function.
I'm not sure about the best sequence.
I have:
1) Slope
2) Scale (* factor)
3) Offset (+ offset)
4) Limit
I'm not sure about the best sequence.
I have:
1) Slope
2) Scale (* factor)
3) Offset (+ offset)
4) Limit
You do not have the required permissions to view the files attached to this post.