Reversing Sensor Data

Sep 21, 2013 at 2:50pm

Reversing Sensor Data

I want to use incoming pot data to decrease gain on one channel and increase gain on the other. How would I do this? I tried an inverse scale, but that didn’t seem to work. Any thoughts?

#265884
Sep 21, 2013 at 3:15pm

M4L.bal1~

#265889
Sep 21, 2013 at 3:58pm

Wetterberg:

I’m not sure how this would work. I’m trying to take serial data received from a potentiometer.

#265890
Sep 21, 2013 at 4:15pm

could you show some of your data then? Otherwise we’ll just be guessing, really.

#265891
Sep 21, 2013 at 5:13pm

The data that is feeding in is a number in a range from 0 – 1023 which is converted from voltage. I run the data into Arduino2Max through an Analog input then out to my gain sliders. Hope that helps.

#265894
Sep 21, 2013 at 5:44pm

if you just want a simple linear relationship use “expr 1023 – $i1″

#265895
Sep 21, 2013 at 7:00pm
– Pasted Max Patch, click to expand. –
#265901
Sep 21, 2013 at 7:12pm

[!- 1023] is faster than both scale and expr.

#265902
Sep 21, 2013 at 10:40pm

Metamax:

Just used the (!-) object and it worked great. I ended up scaling the data numbers down to the max number I set for my various gains so the action went smoother from my perspective. Seemed to work great, thank you.

#265906
Sep 22, 2013 at 1:32am

Note you’ll have a dip in volume in the middle; that’s the reason why I recommended m4l.bal1~ – it does a proper mix between the two.

I still think it’s the best approach, hehe.

#265910

You must be logged in to reply to this topic.