Forums > MaxMSP

expr exponential slider

October 22, 2006 | 12:21 pm

Hi,

I’ve used an expr object to make a slider go from 38 to 20000 exponentially, for use in a parametric eq patch ive made. My lecturer used the object for a demonstration patch he made and it works pretty well. I need to convert the outputted number from expr back into the original slider value exponentially, basically by reversing the equasion in expr, but I don’t understand the arguement in expr to be able to do this. The arguement in expr is as follows:

expr 20000*pow($f1,2.718)

here’s just the conversion part of the patch, could someone please explain the equation and how I do what I previously explained?

max v2;
#N vpatcher 595 386 869 645;
#P user multiSlider 40 200 198 15 0.1 1. 1 2680 47 0 0 2 0 0 1;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P user multiSlider 36 53 198 15 0.1 1. 1 2680 47 0 0 2 0 0 1;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P window setfont "Sans Serif" 9.;
#P flonum 36 115 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 36 86 149 196617 expr 20000*pow($f1\,2.718);
#P connect 2 0 0 0;
#P connect 0 0 1 0;
#P pop;

Many thanks in advance,

Jazz


October 22, 2006 | 12:38 pm

Hello Jazz,

The formula is: x=20000*y^2.718
You need y: y=(x/20000)^(1/2.718)

So, this should work:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 96 206 130 9109513 expr pow($f1/20000\,1/2.718);
#P user multiSlider 96 260 198 15 0.1 1. 1 2680 47 0 0 2 0 0 1;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P user multiSlider 96 113 198 15 0.1 1. 1 2680 47 0 0 2 0 0 1;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P flonum 96 175 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 96 146 123 9109513 expr 20000*pow($f1\,2.718);
#P connect 4 0 3 0;
#P connect 1 0 4 0;
#P connect 0 0 1 0;
#P connect 2 0 0 0;
#P window clipboard copycount 5;


October 25, 2006 | 7:17 am

Hi everyone,

I have been thinking about this for a while now, and
would like to know what the opinions of the community
are…

Apple will be making their newer computer models
equipped with the intel processor, so my prediction is
that slowly the PPC will disappear.
At this point in time I ask if you think it’s a good
investment of a programmer’s time to add Altivec code
(where possible, of course) to his/her custom objects.

Please advise.

Thanks a lot.

- Luigi

————————————————————
THIS E-MAIL MESSAGE IS FOR THE SOLE USE OF THE INTENDED RECIPIENT AND MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. ANY UNAUTHORIZED REVIEW, USE, DISCLOSURE OR DISTRIBUTION IS PROHIBITED. IF YOU ARE NOT THE INTENDED RECIPIENT, CONTACT THE SENDER BY E-MAIL AT SUPERBIGIO@YAHOO.COM AND DESTROY ALL COPIES OF THE ORIGINAL MESSAGE. WITHOUT PREJUDICE UCC1-207.
————————————————————

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

http://mail.yahoo.com


October 25, 2006 | 7:48 am

Im not sure if its possible, but can you use the accelerate framework
that apple provides, or is that only for Obj-C code? if you can use
Accelerate, it should give you altivec as well as SSE2/3 codepaths, no?

if not, id still say yes, as most people are running G4/G5 based
systems for a while now.

v a d e //

http://www.vade.info
abstrakt.vade.info

On Oct 25, 2006, at 3:17 AM, Luigi Castelli wrote:

> Hi everyone,
>
> I have been thinking about this for a while now, and
> would like to know what the opinions of the community
> are…
>
> Apple will be making their newer computer models
> equipped with the intel processor, so my prediction is
> that slowly the PPC will disappear.
> At this point in time I ask if you think it’s a good
> investment of a programmer’s time to add Altivec code
> (where possible, of course) to his/her custom objects.
>
> Please advise.
>
> Thanks a lot.
>
> – Luigi
>
>
> ————————————————————
> THIS E-MAIL MESSAGE IS FOR THE SOLE USE OF THE INTENDED RECIPIENT
> AND MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. ANY
> UNAUTHORIZED REVIEW, USE, DISCLOSURE OR DISTRIBUTION IS
> PROHIBITED. IF YOU ARE NOT THE INTENDED RECIPIENT, CONTACT THE
> SENDER BY E-MAIL AT SUPERBIGIO@YAHOO.COM AND DESTROY ALL COPIES OF
> THE ORIGINAL MESSAGE. WITHOUT PREJUDICE UCC1-207.
> ————————————————————
>
>
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com


Viewing 4 posts - 1 through 4 (of 4 total)