aboutsummaryrefslogtreecommitdiff
path: root/line3
diff options
context:
space:
mode:
authorCyrille Henry <nusmuk@users.sourceforge.net>2005-07-16 22:02:12 +0000
committerCyrille Henry <nusmuk@users.sourceforge.net>2005-07-16 22:02:12 +0000
commitc6e47e390dcc82e2da08352fe6ec9f154d508c55 (patch)
tree0e006111e4d7e1674f68dc48348435695dcd672a /line3
parent9a15b173b7d00668ef7ebbefa1d6ea3b2804d41e (diff)
bugfix with [0,1 100< message
svn path=/trunk/externals/nusmuk/; revision=3353
Diffstat (limited to 'line3')
-rwxr-xr-xline3/line3.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/line3/line3.c b/line3/line3.c
index 2a6e813..25dcd8e 100755
--- a/line3/line3.c
+++ b/line3/line3.c
@@ -68,13 +68,12 @@ void line3_tick(t_line3 *x)
}
else
{
- t = (timenow - x->x_prevtime);
+ t = (timenow - x->x_prevtime);
- tmp = x->a * t * t * t + x->b * t * t + x->setderiv * t + x->x_setval;
+ tmp = x->a * t * t * t + x->b * t * t + x->setderiv * t + x->x_setval;
- outlet_float(x->x_obj.ob_outlet, tmp);
- clock_delay(x->x_clock,
- (x->x_grain > msectogo ? msectogo : x->x_grain));
+ outlet_float(x->x_obj.ob_outlet, tmp);
+ clock_delay(x->x_clock, (x->x_grain > msectogo ? msectogo : x->x_grain));
}
}
@@ -83,10 +82,10 @@ void line3_float(t_line3 *x, t_float f)
double timenow = clock_getsystime();
if (x->x_gotinlet && x->x_in1val > 0)
{
- if (timenow > x->x_targettime)
+ if (timenow >= x->x_targettime)
{
x->x_setval = x->x_targetval;
- x->setderiv = 0;
+ x->setderiv = 0;
}
else
{
@@ -94,8 +93,7 @@ void line3_float(t_line3 *x, t_float f)
x->setderiv = 3 * x->a * (timenow - x->x_prevtime) * (timenow - x->x_prevtime) + 2 * x->b * (timenow - x->x_prevtime) + x->setderiv;
- }
-
+ }
x->x_prevtime = timenow;
x->x_targettime = clock_getsystimeafter(x->x_in1val);
x->x_targetval = f;
@@ -119,6 +117,7 @@ void line3_float(t_line3 *x, t_float f)
{
clock_unset(x->x_clock);
x->x_targetval = x->x_setval = f;
+ x->x_targettime = timenow;
outlet_float(x->x_obj.ob_outlet, f);
}
x->x_gotinlet = 0;