Forums > Jitter

Easiest way of adding 'Ease in Ease Out' to camera animations in GL

August 10, 2007 | 8:19 pm

Hello

Im trying to find a good way of removing the linear look to
animations in GL that are using bline.

Id like to be able to do something like in After Effects and add an
Ease In to the beginning of my bline and an Ease out (usually called
Easy-ease) to the end.

Im having a long/shitty week, anyone want to give me a hand?

Id like to start on the numbers i provide, and end on the numbers I
provide, just, not be so er.. *computer-ish* with those in between,
make it a bit more natural.

Thanks,

v a d e //

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


August 10, 2007 | 8:58 pm

Hi vade,

I’m not sure if this helps, but I received it from Trond Lossius a
while back and found it useful:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 357 197 49 196617 $1 2000;
#P user multiSlider 357 272 169 86 0. 100. 1 3193 15 0 0 2 0 0 0;
#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 button 357 132 15 0;
#P newex 357 170 64 196617 random 100;
#N vpatcher 95 230 695 630;
#P outlet 76 359 15 0;
#P window setfont "Sans Serif" 9.;
#P message 356 236 50 196617 3.141593;
#P newex 356 204 62 196617 prepend set;
#P message 356 148 30 196617 bang;
#P newex 356 178 26 196617 tl.pi;
#P inlet 76 49 15 0;
#P window linecount 1;
#P newex 163 144 39 196617 t b f;
#P message 163 117 20 196617 $1;
#P newex 76 244 23 196617 cos;
#P newex 76 306 155 196617 scale 1. -1. 0. 1.;
#P window linecount 3;
#P message 76 117 61 196617 0. , 3.141593 $2;
#P window linecount 1;
#P newex 163 233 27 196617 f;
#P newex 76 214 53 196617 line 0. 20;
#P connect 7 0 2 0;
#P connect 2 0 0 0;
#P connect 0 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 12 0;
#P connect 7 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 1 0;
#P connect 1 0 3 3;
#P fasten 3 0 1 1 81 339 274 339 274 213 185 213;
#P connect 6 1 3 4;
#P connect 9 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 11 0;
#P pop;
#P newobj 357 225 60 196617 p sin_ramp;
#P message 169 197 49 196617 $1 2000;
#P user multiSlider 169 272 169 86 0. 100. 1 3193 15 0 0 2 0 0 0;
#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 button 169 132 15 0;
#P newex 169 170 64 196617 random 100;
#N vpatcher 95 230 695 630;
#P outlet 76 359 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P message 356 236 50 196617 0.986614;
#P newex 356 204 62 196617 prepend set;
#P message 356 148 23 196617 2.5;
#P newex 356 178 29 196617 tanh;
#P inlet 76 49 15 0;
#P window linecount 1;
#P newex 163 144 39 196617 t b f;
#P message 163 117 20 196617 $1;
#P newex 76 244 29 196617 tanh;
#P newex 76 306 158 196617 scale -0.986614 0.986614 0. 1.;
#P message 76 117 67 196617 -2.5 , 2.5 $2;
#P newex 163 233 27 196617 f;
#P newex 76 214 53 196617 line 0. 20;
#P connect 7 0 2 0;
#P connect 2 0 0 0;
#P connect 0 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 12 0;
#P connect 7 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 1 0;
#P connect 1 0 3 3;
#P fasten 3 0 1 1 81 339 274 339 274 213 185 213;
#P connect 6 1 3 4;
#P connect 9 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 11 0;
#P pop;
#P newobj 169 225 66 196617 p tanh_ramp;
#P connect 7 0 6 0;
#P connect 5 0 8 0;
#P connect 6 0 9 0;
#P connect 9 0 5 0;
#P connect 4 0 0 0;
#P connect 1 0 4 0;
#P connect 0 0 3 0;
#P connect 2 0 1 0;
#P window clipboard copycount 10;

and here’s one that I built, but never used – I forget why:

#P user dial 316 198 40 40 100 1 0 0 159 270 1 1. 170 170 170 221 221
221 120 120 120 225 225 225 0 0 0 0 0 0;
#P user dial 21 203 40 40 100 1 0 0 159 270 1 1. 170 170 170 221 221
221 120 120 120 225 225 225 0 0 0 0 0 0;
#P window setfont "Sans Serif" 9.;
#P flonum 316 176 287 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 316 71 62 196617 mousefilter;
#P newex 316 92 40 196617 t b i i;
#P newex 316 155 217 196617 expr ((cos($f1/63.6666))* ($f3-$f2)) + $f2;
#P newex 522 135 39 196617 bucket;
#P number 316 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 316 134 40 196617 line;
#P message 316 115 68 196617 0 , 100 3000;
#P comment 316 37 100 196617 ease in;
#P flonum 21 177 287 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 21 72 62 196617 mousefilter;
#P newex 21 93 40 196617 t b i i;
#P newex 21 157 209 196617 expr ((sin($f1/63.666))* ($f2-$f3)) + $f3;
#P newex 219 134 39 196617 bucket;
#P number 21 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 21 135 40 196617 line;
#P message 21 116 68 196617 0 , 100 3000;
#P comment 21 38 100 196617 ease out;
#P connect 13 0 14 2;
#P fasten 15 2 13 0 351 112 527 112;
#P fasten 15 1 14 1 336 112 424 112;
#P connect 17 0 19 0;
#P connect 14 0 17 0;
#P connect 11 0 14 0;
#P connect 10 0 11 0;
#P connect 15 0 10 0;
#P connect 16 0 15 0;
#P connect 12 0 16 0;
#P connect 4 0 5 2;
#P fasten 6 2 4 0 56 113 224 113;
#P fasten 6 1 5 1 41 113 125 113;
#P connect 8 0 18 0;
#P connect 5 0 8 0;
#P connect 2 0 5 0;
#P connect 1 0 2 0;
#P connect 6 0 1 0;
#P connect 7 0 6 0;
#P connect 3 0 7 0;
#P window clipboard copycount 20;

Best,

bbw


August 10, 2007 | 9:11 pm


On Aug 10, 2007, at 1:19 PM, vade wrote:

> Hello
>
> Im trying to find a good way of removing the linear look to
> animations in GL that are using bline.
>
> Id like to be able to do something like in After Effects and add an
> Ease In to the beginning of my bline and an Ease out (usually
> called Easy-ease) to the end.
>
> Im having a long/shitty week, anyone want to give me a hand?
>
> Id like to start on the numbers i provide, and end on the numbers I
> provide, just, not be so er.. *computer-ish* with those in between,
> make it a bit more natural.

Hi,

Hope your week gets better. Here is my list_ease abstraction. In
general a common ease fn is 2x^3 – 3x^2 on [0, 1]. Nice because it’s
super easy to compute, and has derivatives of 0 at both ends. If you
wanted to make your fades even less "computer-ish" you could add in
some filtered noise scaled by the ease fn along the way.

-Randy

max v2;
#N vpatcher 547 288 1001 782;
#P window setfont "Sans Serif" 9.;
#P comment 59 438 152 196617 rej@2uptech.com;
#P comment 172 364 59 196617 interpolate;
#P comment 59 37 152 196617 list_ease;
#P comment 59 95 152 196617 – run line from 0-1;
#P comment 59 78 219 196617 – send previous output list to left inlet
of expr;
#N comlet interpolated list out;
#P outlet 110 400 15 0;
#N comlet interpolate to input list;
#P inlet 23 74 15 0;
#N comlet fade time;
#P inlet 391 71 15 0;
#P newex 200 162 37 196617 5000.;
#P message 200 188 50 196617 0. , 1. $1;
#P newex 60 126 40 196617 t b b l;
#P newex 200 211 40 196617 line 0.;
#P newex 200 236 208 196617 expr 3. * $f1 * $f1 – 2. * $f1 * $f1 * $f1;
#P newex 200 288 29 196617 t b f;
#P flonum 200 262 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 247 289 48 196617 loadbang;
#P message 247 312 70 196617 scalarmode 1;
#P newex 75 346 156 196617 vexpr $f1 + (($f2 – $f1) * $f3);
#P newex 75 290 36 196617 zl reg;
#P comment 300 254 109 196617 ease function on [0 , 1];
#P comment 59 61 173 196617 – send new list to right inlet of expr;
#P connect 14 0 10 0;
#P connect 10 1 2 0;
#P connect 7 0 3 0;
#P connect 2 0 3 0;
#P fasten 3 0 2 1 80 383 61 383 61 271 106 271;
#P connect 3 0 15 0;
#P connect 10 2 3 1;
#P fasten 10 0 12 0 65 153 205 153;
#P connect 12 0 11 0;
#P connect 11 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 6 0;
#P connect 6 0 7 0;
#P connect 4 0 3 2;
#P connect 7 1 3 2;
#P connect 13 0 12 1;
#P connect 5 0 4 0;
#P pop;


August 10, 2007 | 9:22 pm

bart woodstrup skrev:
> Hi vade,
>
> I’m not sure if this helps, but I received it from Trond Lossius a
> while back and found it useful:
>
> #P…
oh wow, this is über-useful!

Thanks for sharing.

Andreas.


August 10, 2007 | 9:56 pm


August 10, 2007 | 10:02 pm

Sorry, I meant – Randy -, Can you tell its been a long week? (sigh)
Thanks again.

v a d e //

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


August 10, 2007 | 10:13 pm

You’re welcome, I’m still working my ways through the solution to edge
blending you posted the other day, so it’s nice to be able to provide
something back.

I have another patch that might interest you as well. It’s an
alternative line-approach. Similar to bline in that it updates whenever
banged, but similar to line in that ramping from a to b happens in a
fixed amount of time.

The idea have been to have ramps happening in a fixed amount of time,
but providing as "fresh" values as possible along the way to jitter
hopefully giving as smooth transitions as possible, while maintaining
control over the perceived time that a transition takes, so that not
everything takes twice as long on a slower computer.

I’m eventually panning n implementing all of this as ramp modes in
Jamoma, but haven’t gotten around to it yet.

Best,
Trond

Save as tl.bline.help:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 31 64 326 196617 In addition a number of different ramp
functions are implemented.;
#P button 297 120 15 0;
#P newex 251 283 61 196617 delay 4000;
#P user umenu 348 120 95 196647 1 64 136 1;
#X add linear;
#X add cosine;
#X add tanh;
#X add exp diverging;
#X add exp converging;
#X add gaussian;
#P user multiSlider 261 336 145 87 0. 10. 1 3448 11 0 0 2 0 50 0;
#M frgb 171 180 241;
#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 message 348 159 48 196617 mode $1;
#P newex 310 231 58 196617 print dump;
#P newex 281 139 35 196617 * 10.;
#P hidden newex 83 86 60 196617 loadmess 1;
#P window linecount 4;
#P comment 473 237 296 196617 tl.bline ramps to new value in a fixed
time interval. It outputs values in responce to incoming bangs using CPU
time to calculate current value. This way it provides an updated value
in responce to bang received.;
#P window linecount 1;
#P comment 457 166 100 196617 differs from line:;
#P window linecount 2;
#P comment 473 180 296 196617 line progress in fixed time interval ,
and output values at fixed intervals;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P comment 31 34 100 196620 tl.bline;
#P window setfont "Sans Serif" 9.;
#P comment 31 52 326 196617 Line driven by bang , but progressing
according to absolute (CPU) clock.;
#P button 251 264 15 0;
#P number 139 143 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 281 120 15 0;
#P user multiSlider 261 328 145 8 0. 10. 1 2936 7 0 0 1 0 0 0;
#M frgb 45 65 219;
#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 message 281 159 49 196617 $1 4000;
#P button 205 328 15 0;
#P flonum 223 328 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 243 120 35 9 0. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 205 120 35 9 0 10 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 83 120 15 0;
#P newex 83 143 52 196617 metro 50;
#P newex 205 231 102 196617 tl.bline 0.8 @mode 0;
#P comment 267 265 100 196617 done with ramp;
#P comment 457 114 100 196617 differs from bline:;
#P window linecount 2;
#P comment 473 128 296 196617 bline progress to new target in a given
number of bangs. How long this takes depends on the frequency of bangs
received.;
#P window linecount 1;
#P message 83 202 47 196617 getmode;
#P comment 26 203 55 196617 not yet ->;
#P connect 27 0 25 0;
#P connect 5 2 24 0;
#P connect 14 0 23 0;
#P hidden connect 14 0 29 0;
#P connect 23 0 12 0;
#P fasten 28 0 14 0 256 306 447 306 447 109 286 109;
#P lcolor 1;
#P connect 13 0 26 0;
#P fasten 5 0 11 0 210 281 210 281;
#P fasten 5 0 10 0 210 319 228 319;
#P fasten 5 0 13 0 210 319 266 319;
#P connect 16 0 28 0;
#P connect 5 1 16 0;
#P fasten 25 0 5 0 353 192 210 192;
#P fasten 8 0 5 0 210 183 210 183;
#P fasten 9 0 5 0 248 192 210 192;
#P fasten 12 0 5 0 286 192 210 192;
#P fasten 6 0 5 0 88 174 210 174;
#P fasten 1 0 5 0 88 226 210 226;
#P fasten 15 0 6 1 144 160 137 160 137 140 130 140;
#P connect 7 0 6 0;
#P hidden connect 22 0 7 0;
#P window clipboard copycount 31;

Save as tl.bline.pat:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 36 68 67 196617 loadmess $1;
#P outlet 511 557 15 0;
#P newex 131 510 27 196617 f;
#P newex 546 377 20 196617 t b;
#P newex 511 408 45 196617 onebang;
#P newex 244 227 20 196617 t b;
#P message 112 135 31 196617 $1 0;
#P newex 426 345 20 196617 t b;
#P newex 131 471 27 196617 f;
#P newex 382 318 54 196617 split 0. 1.;
#P newex 190 288 29 196617 t b f;
#P newex 190 351 27 196617 f;
#P newex 228 411 81 196617 scale 0. 1. 0. 1.;
#N vpatcher 49 74 649 474;
#P outlet 211 360 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N vpatcher 59 89 659 489;
#P window setfont "Sans Serif" 9.;
#P newex 98 147 30 196617 !- 1.;
#P newex 98 114 74 196617 expr exp($f1);
#P newex 98 86 86 196617 scale 0. 1. 0. -5.;
#P outlet 98 199 15 0;
#P inlet 98 47 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 1 0;
#P pop;
#P newobj 172 203 55 196617 p exp_dec;
#N vpatcher 59 89 659 489;
#P window setfont "Sans Serif" 9.;
#P newex 98 114 74 196617 expr exp($f1);
#P newex 98 86 86 196617 scale 0. 1. -5. 0.;
#P outlet 98 199 15 0;
#P inlet 98 47 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P pop;
#P newobj 158 232 53 196617 p exp_inc;
#N vpatcher 59 89 659 489;
#P window setfont "Sans Serif" 9.;
#P newex 98 146 86 196617 scale -1. 1. 0. 1.;
#P newex 98 114 29 196617 tanh;
#P newex 98 86 86 196617 scale 0. 1. -4. 4.;
#P outlet 98 199 15 0;
#P inlet 98 47 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 1 0;
#P pop;
#P newobj 144 261 37 196617 p tanh;
#N vpatcher 59 89 659 489;
#P outlet 95 165 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 95 129 86 196617 scale 1. -1. 0. 1.;
#P newex 95 81 117 196617 scale 0. 1. 0. 3.141593;
#P newex 95 106 23 196617 cos;
#P inlet 95 59 15 0;
#P connect 0 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P pop;
#P newobj 130 290 33 196617 p cos;
#P window linecount 0;
#N vpatcher 59 89 659 489;
#P outlet 83 109 15 0;
#P inlet 83 59 15 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 116 319 44 196617 p linear;
#P inlet 172 91 15 0;
#P newex 116 121 27 196617 + 1;
#P newex 116 160 66 196617 gate 5;
#P inlet 116 91 15 0;
#P connect 0 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P connect 1 1 5 0;
#P connect 1 2 6 0;
#P connect 1 3 7 0;
#P connect 3 0 1 1;
#P connect 1 4 8 0;
#P connect 4 0 9 0;
#P connect 5 0 9 0;
#P connect 6 0 9 0;
#P connect 7 0 9 0;
#P connect 8 0 9 0;
#P pop;
#P newobj 346 340 46 196617 p modes;
#P newex 382 293 101 196617 expr ($f1-$f2)/$f3;
#P newex 190 166 64 196617 unpack 0. 0.;
#P outlet 131 557 15 0;
#P inlet 112 69 15 0;
#P newex 112 100 208 196617 route float int list mode bang;
#P newex 382 176 48 196617 cpuclock;
#P newex 244 248 48 196617 cpuclock;
#P connect 17 0 16 1;
#P connect 5 1 15 0;
#P fasten 5 1 6 2 249 221 477 221;
#P fasten 5 1 17 0 249 219 551 219;
#P connect 16 0 19 0;
#P fasten 13 0 12 0 431 447 136 447;
#P connect 13 0 16 0;
#P fasten 0 0 6 1 249 270 432 270;
#P connect 11 1 13 0;
#P connect 11 0 7 1;
#P connect 6 0 11 0;
#P connect 1 0 6 0;
#P connect 2 4 1 0;
#P connect 2 3 7 0;
#P fasten 10 1 8 4 214 325 289 325;
#P fasten 9 0 8 3 195 373 275 373;
#P connect 15 0 0 0;
#P connect 7 0 8 0;
#P connect 18 0 4 0;
#P fasten 18 0 9 1 136 536 88 536 88 342 212 342;
#P connect 10 0 9 0;
#P fasten 5 0 12 1 195 195 153 195;
#P connect 5 0 10 0;
#P connect 14 0 5 0;
#P connect 2 2 5 0;
#P fasten 8 0 18 0 233 504 136 504;
#P connect 12 0 18 0;
#P connect 2 1 14 0;
#P connect 2 0 14 0;
#P connect 3 0 2 0;
#P fasten 20 0 2 0 41 92 117 92;
#P window clipboard copycount 21;

vade wrote:
> Thank you Rnady and Bart (and Trond) very much. This has been
> illuminating. Randy, the ease function is perfect for what I need and I
> can easily adapt that to bline with a JS.
>
> ill hopefully post something back to you all shortly.
>
> Thanks for making my day less shitty :)


August 11, 2007 | 12:44 am

Here is a js + helpfile for a bline helper that creates ‘n’ ease in
and ease out steps for bline automatically for you.

I think this is actually really helpful, and easy to drop in place
between a current message and bline. This will be included in my next
v001 release, but er, let me know what you folks think. Thanks again
folks for the help.

#P window setfont "Sans Serif" 9.;
#P number 410 311 35 9 3 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 410 333 59 196617 setease $1;
#P message 304 284 67 196617 -30 , 100 40;
#P message 282 268 62 196617 0 , 100 300;
#P message 253 251 72 196617 -30 , -10 200;
#P message 217 232 67 196617 -10 , 30 100;
#P button 410 413 15 0;
#P button 178 413 15 0;
#P flonum 373 413 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user multiSlider 373 451 196 92 -50. 100. 1 3193 15 0 0 2 0 0 0;
#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 138 450 196 92 -50. 100. 1 3193 15 0 0 2 0 0 0;
#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 newex 373 386 43 196617 bline 0.;
#P newex 373 361 116 196617 js v001.lib.easyease.js;
#P flonum 138 413 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 138 387 43 196617 bline 0.;
#P toggle 138 211 15 0;
#P newex 138 235 60 196617 qmetro 33.;
#P comment 56 192 607 196617 Ease in Ease out with interpolated steps
for bline.;
#P comment 56 176 92 196617 v001.lib.easyease;
#B frgb 200 4 140;
#P connect 3 0 2 0;
#P fasten 16 0 4 0 309 343 143 343;
#P fasten 15 0 4 0 287 335 143 335;
#P fasten 14 0 4 0 258 326 143 326;
#P fasten 13 0 4 0 222 317 143 317;
#P connect 2 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 8 0;
#P connect 4 1 11 0;
#P fasten 16 0 6 0 309 330 378 330;
#P fasten 15 0 6 0 287 322 378 322;
#P fasten 14 0 6 0 258 313 378 313;
#P fasten 13 0 6 0 222 304 378 304;
#P connect 17 0 6 0;
#P connect 2 0 7 0;
#P connect 6 0 7 0;
#P connect 7 0 10 0;
#P connect 10 0 9 0;
#P connect 18 0 17 0;
#P connect 7 1 12 0;
#P window clipboard copycount 19;

save as v001.lib.easyease.js

// attempt to take a simple bline message like 0, 10 5000 (go from 0
to 10 in 5000 bangs) and make it into a nice interpolated event.

outlets = 0; // one outlet that goes to bline
var ease = 10; // ‘interpolation steps

var initial_value = 0;
var dest_value = 100;

// typically we send messages such as 0. , 10 5000, which is actually
two messages to this js.
// we handle the first message by simply passing it through.
// the second message is where we do our easing.

function list(a)
{
if(arguments.length ==1)
{
initial_value = arguments[0];

outlet(0, arguments[0]); // just pass it through
}

else if(arguments.length == 2)
{
// build an array that has ‘ease’ number of elements in it * 2 (one
for destination one for num of bangs).
var output_to_bline_array = new Array(ease * 2);

dest_value = arguments[0];

increment_bangs = arguments[1]/ease;

var output_to_bline = "";

// our ease functon is 2x^3 – 3x^2 – we approximate a smooth curve
by iterating n times. ease is the number of times we iterate.
for(i=1; i< = ease; i++)
{
// x ranges from 0 – 1.
x = i/ease;

// this applies our ease function
temp = ( (Math.pow( (x) , 3.0)* 2.0 ) – (Math.pow( (x) , 2.0) *
3.0) ) * -1;

// unscale from 0 1 to our original size
scaled_temp = scale(0, 1, initial_value, dest_value, temp);

output_to_bline_array[(i - 1) * 2 ] = scaled_temp;
output_to_bline_array[(i - 1) * 2 +1 ] = increment_bangs;
//output_to_bline += scaled_temp+ " "; // unscaled
//output_to_bline += increment_bangs + " ";
//outlet(0, scaled_temp, increment_bangs);
}
//post("ease size is "+ ease, "output_size is " +
output_to_bline_array.length);
outlet(0, output_to_bline_array);

}
}

// scaling function. like zmap n shit
function scale(a, b, c, d, x)
{
return (x -a) * (d -c)/(b -a) + c;
}

// how many iterations do we want to make ?
function setease(x)
{
ease = x;
}


August 13, 2007 | 9:00 pm

this looks all very interesting…but I can’t get the js to work – methinks it’s a problem w/ line breaks. can you post as attachment(s)?


August 13, 2007 | 10:39 pm

I "fixed" it after it came through my email. Let me know if there are
any problems.

Thanks,
Keith

On 8/13/07, pnyboer

wrote:
>
> this looks all very interesting…but I can’t get the js to work – methinks it’s a problem w/ line breaks. can you post as attachment(s)?
>
>
> –
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> The Lifespan
> 2 oz brandy
> 1/2 oz orgeat
> 1/2 oz maraschino
> 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice
> Shake with ice and serve in a Pernod-rinsed cocktail glass
>


August 14, 2007 | 2:24 am

I posted a version up on my blog with a help file:

http://abstrakt.vade.info/ILOVETHEMAXLIST/v001.easyease.zip

On Aug 13, 2007, at 6:39 PM, keith manlove wrote:

> I "fixed" it after it came through my email. Let me know if there are
> any problems.
>
> Thanks,
> Keith
>
> On 8/13/07, pnyboer

wrote:
>>
>> this looks all very interesting…but I can’t get the js to work –
>> methinks it’s a problem w/ line breaks. can you post as attachment
>> (s)?
>>
>>
>> –
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> The Lifespan
>> 2 oz brandy
>> 1/2 oz orgeat
>> 1/2 oz maraschino
>> 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice
>> Shake with ice and serve in a Pernod-rinsed cocktail glass
>>
>>

v a d e //

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


August 14, 2007 | 9:49 am

Hi Lindsay,

Just wondered if you could could spare 5 minutes for a quick chat
about a couple of things.

Cheers

Jack
On 14 Aug 2007, at 03:24, vade wrote:

> I posted a version up on my blog with a help file:
>
> http://abstrakt.vade.info/ILOVETHEMAXLIST/v001.easyease.zip
>
> On Aug 13, 2007, at 6:39 PM, keith manlove wrote:
>
>> I "fixed" it after it came through my email. Let me know if there
>> are
>> any problems.
>>
>> Thanks,
>> Keith
>>
>> On 8/13/07, pnyboer

wrote:
>>>
>>> this looks all very interesting…but I can’t get the js to work
>>> – methinks it’s a problem w/ line breaks. can you post as
>>> attachment(s)?
>>>
>>>
>>> –
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> The Lifespan
>>> 2 oz brandy
>>> 1/2 oz orgeat
>>> 1/2 oz maraschino
>>> 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice
>>> Shake with ice and serve in a Pernod-rinsed cocktail glass
>>>
>>>
>
> v a d e //
>
> http://www.vade.info
> abstrakt.vade.info
>
>
>


August 14, 2007 | 10:51 am

OOPS, Please ignore me hitting reply instead of new,

JK
On 14 Aug 2007, at 10:49, jack keenan wrote:

> Hi Lindsay,
>
> Just wondered if you could could spare 5 minutes for a quick chat
> about a couple of things.
>
> Cheers
>
> Jack
> On 14 Aug 2007, at 03:24, vade wrote:
>
>> I posted a version up on my blog with a help file:
>>
>> http://abstrakt.vade.info/ILOVETHEMAXLIST/v001.easyease.zip
>>
>> On Aug 13, 2007, at 6:39 PM, keith manlove wrote:
>>
>>> I "fixed" it after it came through my email. Let me know if
>>> there are
>>> any problems.
>>>
>>> Thanks,
>>> Keith
>>>
>>> On 8/13/07, pnyboer

wrote:
>>>>
>>>> this looks all very interesting…but I can’t get the js to work
>>>> – methinks it’s a problem w/ line breaks. can you post as
>>>> attachment(s)?
>>>>
>>>>
>>>> –
>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>> The Lifespan
>>>> 2 oz brandy
>>>> 1/2 oz orgeat
>>>> 1/2 oz maraschino
>>>> 3/4 oz mix of (meyer) lemon and (yellow) grapefruit juice
>>>> Shake with ice and serve in a Pernod-rinsed cocktail glass
>>>>
>>>>
>>
>> v a d e //
>>
>> http://www.vade.info
>> abstrakt.vade.info
>>
>>
>>
>


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