interpolation between 2 consecutive samples (gen~)

Olivier Pasquet's icon

Hi!

How would you make an optimized 4 sample interpolation between 2 consecutive values ?

Thanks !

ps : Long time I have not posted something ! :)

pid's icon

/Max 6/examples/gen/gen~.interpolation.maxpat

p.s. - we missed you!

Olivier Pasquet's icon

Ohh thanks!
If I understand well, there is no already prepared "line" external. :)
Here is a piece of code that interpolates from one sample to the next within a minimum amount of time. The interpolation starts as soon as a new signal value arrives. Also, it works like a line for new incoming values when interpolation has not ended yet.
I have noticed History does not work when it is outside of a function.

Max Patch
Copy patch and select New From Clipboard in Max.

Graham Wakefield's icon
Max Patch
Copy patch and select New From Clipboard in Max.

It's probably less sophisticated that what you're looking for, but here's a pseudo-line~ for gen~:

Graham Wakefield's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Whoops, loadmess was firing to soon. Try this:

pid's icon

thanks.

Max Patch
Copy patch and select New From Clipboard in Max.

i thought it would be very simple to turn this into a reusable function. but it isn't. why will this not compile? the errors are cryptic. (and i think 'step' was superfluous?).

Graham Wakefield's icon

You're right, step was superfluous -- a bit of code that wasn't being used anymore.

Why it doesn't compile is being looked into, flagged as ticket #3633.