Math with MIDI controller parameters

pantracols's icon

Hi, I'm new here.
I'm designing a patch with a lot of math calculations for control signals that come from a MIDI controller (knobs)
My problem is that when i make a simple expression like
expr $i1+$i2
the output olny updates its value when $i1 changes, but not when $i2 changes.
does anybody know a way to have an updated value at the output when any of the inputs changes?
Thanks!!!

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

The [pak] object will help. Also I'd recommend using straight math operators if you only need one of them in your equation, for example use [-] rather than [expr $i1-$i2]. Here's a patch:

pantracols's icon

Thanks luke!!
i'm sorry to ask this but, how can I use the code you posted to create a maxpat file?

jvkr's icon

You should read this thread (it's a bit hidden):
https://cycling74.com/forums/common-max-arcana

pantracols's icon

thank you guys!!
it's amazing how well this community works

Roman Thilenius's icon

5       7
|        |
|     [t b i]
|  /          |
[expr $i1-$i2]
 |