Re: Curve recommendations
- From: matt271829-news@xxxxxxxxxxx
- Date: Tue, 12 Feb 2008 03:55:05 -0800 (PST)
On Feb 12, 7:52 am, RossClem...@xxxxxxxxx wrote:
On Feb 12, 1:36 am, matt271829-n...@xxxxxxxxxxx wrote:
On Feb 11, 2:15 pm, RossClem...@xxxxxxxxx wrote:
Dear all,
I would like to use "interesting curves" for "sliders" on software
music synthesisers. Typically these synths will have "sliders" which
are a vertical or horizontal line, along which a point can be dragged
from say minimum value (bottom or left of the line) to maximum value
(top or right of the line). I'd like to use other shapes other than a
straight line. For example, I could use an arc from a circle. When
dragging the point along the arc, I'd be calculating the closest
position between the arc and the mouse position (x,y), and moving the
point on the arc representing the parameter value to that point. I'd
also need to extract the parameter value from that
If I use an arc from a circle, then I can easily find the minimum
distance between any point and the arc. I can then easily turn that
into a %age value along the arc by extracting the angle from the
origin to that point, and comparing to the minimum and maximum values
for the arc. Job done, if I was sensible.
However, I'm wondering if there are other interesting curves which I
could use. As far as I can see, any function where I can solve for x'
and f(x') (the closest point) from the mouse click (x,y)
d (x-x')*(x-x') + (f(x')-y') * (f(x')-y') d x' = 0
and where there is a single, or at least a small number of minimums/
maximums. It would also help if I could quickly convert x',f(x') into
a %age along the visible curve. The domain of x' can be chosen
arbitrarily.
What I'd like to ask is if there are any "interesting" curves that
might be worth looking into. S shaped curves and the like.
I should warn people that I have no strong reason or requirement to do
this, it's just an "interesting problem".
Any recommendations/comments?
I can't figure this out. If all you're doing by sliding the point is
ending up with a single percentage value "along the curve", then what
is the purpose of using anything other than a straight line? What
difference does it make? (Or is that what you mean by having no strong
reason or requirement to do it? Is it just to make the thing look sexy
perhaps?)
Yes, that is the sole reason. To make the thing look sexy.
The requirement to solve the closest-point and arc-length equations
analytically seems to quite drastically limit your choice of curve.
Maybe you could drop that requirement and instead use numerical
approximations, especially since the accuracy needed is presumably low
-- no more than one part in however many pixels the slider extends to.
You might even get away with a dumb distance check on each pixel
positition along the curve.
Another possibility would be to splice together circular arcs. Two of
these should give you a reasonably decent S-shape. Then you can solve
the equations individually for the arcs and get your answer that way.
.
- References:
- Curve recommendations
- From: RossClement
- Re: Curve recommendations
- From: matt271829-news
- Re: Curve recommendations
- From: RossClement
- Curve recommendations
- Prev by Date: salam
- Next by Date: Re: 1-1/2+1/3-1/4+1/5-1/6+1/7
- Previous by thread: Re: Curve recommendations
- Next by thread: Test Bank
- Index(es):
Relevant Pages
|