Pattr Interpolation: Toggle vs. Slider

Isaac Smith's icon

Hi All,

This seems like such a basic question but I have been wrestling with this issue for months and I can't find anything to answer it in the Max Tutorials, on the forum, or on YouTube tutorials regarding pattr objects. How can I move from cue to cue in pattrstorage and deal with both toggle objects, which only need a single 1 or 0 as soon as the new cue starts, but also interpolate smoothly between states on sliders, gain objects, or number boxes? For example, in this simple patch I have attached, how can I move between my saved presets where the gate is opened up immediately, but the gain sliders might take 5 or 10 seconds to move between their various states?

test.json
application/json 0.68 KB

TestPattr.maxpat
Max Patch

Source Audio's icon

gate will pop when switched like that, it makes no sense.
But to your question - you can interpolate between presets
and also set each parameter to use interpolation or not.
All is visible in help files.
example: send message singate interp off to pattrstorage
to deactivate interpolation for singate object.
or interp singain linear
then you can use float 0. - 1. as ramp or whatever to slide between presets.
Other option is not to use interpolation at all, but dedicated ramps for your objects,
for example line to drive a slider.
store a list 40 2000 to go to value 40 in 2000 ms.

Isaac Smith's icon

Turning off interpolation doesn't work for my toggle objects because toggles wouldn't turn on until the 2nd preset had fully arrived. For instance, if moving from preset 1 (where toggle is set to 0) to preset 2 (where toggle is set to 1) over 10 seconds, the toggle would not actually turn on until 10 seconds after it had been cued, which is not the effect I am after.

The second option of using individual lines is going to be the way to go! I was trying to get too clever with my use of pattr and hadn't come up with this solution yet even though it seems so simple now that you say it. Thanks for helping me solve this issue!

Source Audio's icon

maybe you forgot threshold parameter.
You can set toggle thresh to anywhere between 0. and 1.
set to 0. it will switch immediatelly, if set to 1. at end of ramp.