0

The basic argument for object [line] is a pair of destination/time value, but there's another possible argument - grain, sets the time interval, which is hard to understood.

If [line] is calculating the ramping time (since it's given destination/time value), how does the grain work? [line] is doing linear ramp, so the time interval should be determined by the value you gave it. That makes the argument grain unnecessary. How to understand this argument for the object [line]?

Sylvia
  • 11
  • 2

1 Answers1

0

The grain argument specifies how often [line] outputs a new value.

What is not specified in the docs is that when you send [line] a new destination value to ramp to, it will start from the previously output value, not from the interpolated value at the time your new message arrives at the object. This means the grain setting can influence its interpolation behavior.

E.g. with grain at 100 ms, sending it 4. 1000 and 50 ms later you send it 8. 1000, the latter line will ramp from 0 to 8., not from the expected 0.2 to 8.

Mattijs
  • 1,909
  • 3
  • 19
  • 28
  • without setting a grain, the [line] will calculate "how often" to ramp out a value. but when you ask [line] to ramp out at a specific grain, it actually changes this linear ramping out behaviour. is it correct? (I just tried to give a '4. 1000 500' message to a [line]) – Sylvia Jan 02 '23 at 12:25
  • Without specifying the grain argument, the default grain value is 20 ms. However indeed once you send it a grain value as an argument, it will keep that new grain until is was changed. – Mattijs Jan 02 '23 at 13:24