Trying to recreate the weighted interpolation math from the recallmulti message for preset, pattrstorage

dequalsrxt's icon

I've been working on an interpolation patch that works with lists of different lengths. I've got it working with 2 lists at a time so it can go from list 1 to 2, then 2 to 3, and so on. I decided it might be nice to interpolate multiple lists at a time, like using the recallmulti message with preset/pattrstorage. But I'm having difficulty figuring out the weighted interpolation, the relationship between the different values. I'm really not very good with math!

The attached patch is just the interpolation tab from the preset help file with the knobs swapped with float number boxes to monitor the values and then a gen patch where I started to try to work it out, but I didn't get very far. I know I need some modulo, comparators, and or logic. Beyond that, I'm stuck. I could probably figure it if I bang my head against the wall some more, but maybe someone around here has an idea so I can avoid a concussion.

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