[PD-dev] line bug
cyrille henry
ch at chnry.net
Tue Jun 12 17:05:28 CEST 2018
hello,
I made a bug report on github regarding a bug of the line object :
When a "stop" message is send after the end of a ramp, the origin of the next ramp is incorrect.
This have been introduce with pd 0.48
attachment is a patch that show the problem:
line_bug.pd.zip
The fix is simple : the x->x_setval should only be set if (clock_getsystime() < x->x_targettime)
The correct line_stop function should be :
static void line_stop(t_line *x)
{
if ((pd_compatibilitylevel >= 48) && (pd_compatibilitylevel < 49))
x->x_setval += x->x_1overtimediff * (clock_getsystime() - x->x_prevtime)
* (x->x_targetval - x->x_setval);
if (pd_compatibilitylevel >= 49)
if (clock_getsystime() >= x->x_targettime)
x->x_setval = x->x_targetval;
else
x->x_setval += x->x_1overtimediff * (clock_getsystime() - x->x_prevtime)
* (x->x_targetval - x->x_setval);
x->x_targetval = x->x_setval;
clock_unset(x->x_clock);
}
(sorry, I have no time for a clean pull request)
More information about the Pd-dev
mailing list