reverse a value ?

Discuss Lemur and share techniques.
Post Reply
oran-outan
Newbie
Posts:39
Joined:18 Dec 2011 17:30
reverse a value ?

Post by oran-outan » 01 Dec 2013 18:04

HI
I search a away to reverse a value. I'm thinking "range" can do this but :
e = range(x, 0, 10) or e = range(x, 10, 0) back the same result.

How can I reverse a value ???

I have used this below whose run but I think there is more efficient for doing the same... and it's ok for a short list but if more longer °°°
-------
decl i;

if (e == 0) i = 10;
if (e == 1) i = 9;
if (e == 2) i = 8;
if (e == 3) i = 7;
if (e == 4) i = 6;
if (e == 5) i = 5;
if (e == 6) i = 4;
if (e == 7) i = 3;
if (e == 8) i = 2;
if (e == 9) i = 1;
if (e == 10) i = 0;
-------

thanks for your help
0-0

Phil999
Regular
Posts:932
Joined:11 Jan 2012 01:53

Re: reverse a value ?

Post by Phil999 » 01 Dec 2013 18:49

if the max value is known:

Code: Select all

i=10-e;
note that you can also reverse object's in/output values in the scale section. By default OSC values go from 0 to 1, but you can set them to 1 to 0. Same with MIDI using 127.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro

oran-outan
Newbie
Posts:39
Joined:18 Dec 2011 17:30

Re: reverse a value ?

Post by oran-outan » 01 Dec 2013 20:23

Thanks


a



LOT...

best
0-0

Post Reply