Linear interpolation?

leaozinho's icon

I know this might be basic for more advanced gen~ users, but I'm really stumbling here.

I am trying to implement a way to interpolate linearly between two values in my gen~ patch. For example, say the current value is 0.25. The new value is 0.75. I want to interpolate from 0.25 to 0.75 over 20ms (I know this will be converted to samples in gen). How can I do this? My initial thought was to use counter, but I think this would entail some kind of lookup table where X is the samples and Y is a set of values ranging from 0.25 to 0.75. Is there a better way to implement this?

Essentially I want the equivalent of a [line~] object with a message "$1 20".

Thank you in advance.

Ernest's icon