ramping numbers...

karl krach's icon

ok, i am quite sure this is a totally stupid problem but i just can't get my head around this:
i have three float parameters (0.-1.) which should influence each other over time in the following way:
1. 0. 0. > 0. 1. 0. > 0. 0. 1. and reverse:
0. 0. 1. > 0. 1. 0. > 1. 0. 0.

they should ramp softly from 0. to 1. and back - for which i use "line". the sum of all three floats needs to be = 1. at any given point.
i attached a patch with my efforts, which is not working (red part).

background: i use a video fader with 3 inputs: image1, transition image, image2. image1 and image2 should fade into each other but always show the transition image in between. i use the fourway mixer of tutorial 43, which works perfectly fine - except i don't manage to give it the proper fading amount parameters.

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

any help is, as always, greatly appreciated!
k

karl krach's icon
Max Patch
Copy patch and select New From Clipboard in Max.

i think i figured it out... it seems really complicated though...

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

just to simplify very slightly, i'd use a reverse-minus operator [!- 1.] instaed of this

but you're probably not going to get much simpler than that. you can always encapsulate it

another thing-- i'd put a [deferlow] object on your outputs if you're doing video transitions to avoid crashing

karl krach's icon

thanks for your quick reply - if it has to be that big ok, i just thought maybe i am missing some command or something since it seemed like some standard operation to me...
your suggestion works fine!
best
k

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

Would something like this work?

$Adam's icon

How about this?

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

BTW, if you really care about not flooding the system, you'd pick [jit.qball] instead of [deferlow], as the former uses a qelem to ensure that the scheduler doesn't get flooded.

HTH,
Ádám

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

Here's yet another way of doing it :)

karl krach's icon

these all work nicely, thank you all for your help!
k

Wetterberg's icon

... I like using multislider and pattrstorage to do that kind of morph, especially since you can make it exponential.