RampLib: scheduler have timing issue
|Assignee:||Trond Lossius||% Done:|
|Category:||-||Spent time:||0.15 hour|
The scheduler jumps immediately to the first step of the ramp instead of waiting. Hence it finish of to early.
I have just added two tests for jcom.ramp that illustrates the issue.
#1 Updated by Adrian Gierakowski over 9 years ago
I don't know if that is the case but maybe it has been implemented this way to be consistent with max's line. Here is what is written about it in line.maxhelp:
The line object starts its progress to the destination immediately (i.e., starts progressing FROM the specified starting point, but does not necessarily start AT it). So it actually arrives at its destination one grain's worth of time EARLIER than the total time specified.
I didn't have a chance to look at your test but I suppose this is what is happening with jcom.ramp.
#3 Updated by Trond Lossius over 9 years ago
- Status changed from New to Closed
Having discussed with Tim on Skype, we agreed on implementing a behavior that differs from standard Max line, but make more sense to us:
- jcom.ramp will output start value immediately
- it will then start ramping towards target value.
We have a
jcom.ramp object with:
- drive: scheduler
- granularity: 100 ms
- function: linear
We send the combined message
0, 1000 1000
This cause the following output:
0 at 0 ms 100 at 100 ms 200 at 200 ms 300 at 300 ms ... 900 at 900 ms 1000 at 1000 ms
This is implemented in rb20a9ff7a9, and closes this issue.