Forums > MaxMSP

### Logarithmic to lineair.

May 31 2011 | 10:30 am

Hi guys,

my mathematical skills aren’t that great, so I’m hoping some one can help me with the following problem.
I’ve connected a potentiometer to an arduino, and it returns values between 0 and 1024.
The problem is that it doesn’t output these values on a lineair scale, but rather in a logarithmic way.

So I’m wondering, is there anyway to correct this?
To convert log to lin?

Any help in the right direction would help me and my colleagues a bunch.
Thanks!

May 31 2011 | 12:47 pm

rogier

best&easiest way would be to get yourself a linear pot.
(can’t imagine rob and aart can’t provide one :)

rob

May 31 2011 | 12:47 pm

rogier

best&easiest way would be to get yourself a linear pot.
(can’t imagine rob and aart can’t provide one :)

rob

May 31 2011 | 3:39 pm

Hey there,

In case changing the pot is not an option for some reason, I would try to use lp.scampi or lp.scampf from the excellent—and free—Litter Power collection of externals. Arguments would have to be something like [lp.scampf map 0. 1024. 0. 1024. pow -1], I guess, but maybe Peter can chime in in case I am wrong.
Vary the ‘-1’ until you get the output curve you’d like.

You’ll find the objects here:
http://www.bek.no/~pcastine/Litter/

Good luck!
Klaas-Jan

May 31 2011 | 3:39 pm

Hey there,

In case changing the pot is not an option for some reason, I would try to use lp.scampi or lp.scampf from the excellent—and free—Litter Power collection of externals. Arguments would have to be something like [lp.scampf map 0. 1024. 0. 1024. pow -1], I guess, but maybe Peter can chime in in case I am wrong.
Vary the ‘-1’ until you get the output curve you’d like.

You’ll find the objects here:
http://www.bek.no/~pcastine/Litter/

Good luck!
Klaas-Jan

Jun 01 2011 | 5:13 am

a few ways to experiment with an [expr] curve, you can get pretty much anything you want with enough tweaking :)

``````
-- Pasted Max  Patch, click to expand. --

```
```
Jun 01 2011 | 5:13 am

a few ways to experiment with an [expr] curve, you can get pretty much anything you want with enough tweaking :)

``````
-- Pasted Max  Patch, click to expand. --

```
```
Viewing 7 posts - 1 through 7 (of 7 total)

Forums > MaxMSP