Slope functions?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

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

Post

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?

Post

For purposes like envelope generator and key velocity scaling.

Post

Chris-S wrote:For purposes like envelope generator and key velocity scaling.
If you've normalized values you could do some kind of rational mapping:

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);
e.g. m = 0.25 ; m = 0.75 yields to
rationalmap.png
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.

Post

Thanks that looks good.

Post

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 :)
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.

Post

xoxos wrote: inverse "curve" to x*x [0,1]
x*(2-x)
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.

Post

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
slope01.png
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “DSP and Plugin Development”