smart speedlim

Mar 3, 2006 at 10:43pm

smart speedlim

please help.
there is some weired behaviour with a pretty simple task involving a
coll-object:

i try to build an abstraction, that is like speedlim, but keeps track
of different “message-headers”.

(eg. consider a busy midi (or osc) port, where you don’t want to
loose the current state of a parameter).

the patch below tends to crash, or ouputs weired data (too long lists).

maybe somebody has a better solution for the task, or any hints to
improove the patch.

thanks
klaus

max v2;
#N vpatcher 263 94 884 697;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 217 177 57 196617 pack 0 0 0;
#P newex 217 153 45 196617 buddy 3;
#P newex 218 121 40 196617 ctlin;
#P newex 269 421 32 196617 print;
#P number 102 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 60 127 15 0;
#N counter 0 1000;
#X flags 0 0;
#P newobj 60 178 80 196617 counter 0 1000;
#P newex 60 152 46 196617 metro 3;
#P number 349 337 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 358 359 148 196617 slice adress (default==2);
#P number 309 271 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 60 230 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 60 261 40 196617 1 1 $1;
#P number 132 230 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 132 261 40 196617 1 2 $1;
#P comment 318 293 148 196617 lim-time in ms (default==100);
#N vpatcher 423 91 1185 922;
#P toggle 598 426 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 598 461 29 196617 gate;
#P window linecount 1;
#P newex 598 487 53 196617 print was;
#P button 372 291 15 0;
#P window linecount 0;
#P comment 493 682 144 196617 remove index that was output;
#N coll $0buff 1;
#P newobj 314 255 69 196617 coll $0buff 1;
#N coll $0buff 1;
#P newobj 409 705 69 196617 coll $0buff 1;
#P newex 409 680 81 196617 prepend remove;
#P newex 392 625 27 196617 t l b;
#P newex 392 601 52 196617 prepend e;
#P newex 406 536 63 196617 fromsymbol;
#P newex 406 558 61 196617 prepend set;
#P newex 290 323 30 196617 t b 0;
#P newex 409 649 35 196617 zl reg;
#P newex 406 503 68 196617 route symbol;
#P button 369 484 15 0;
#P newex 407 388 27 196617 gate;
#P newex 377 345 40 196617 t 1 b 1;
#P newex 377 321 44 196617 del 100;
#P newex 180 236 40 196617 t 2 l b;
#P number 180 87 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 109 144 196617 gate 2 1;
#N coll $0buff 1;
#P newobj 392 480 69 196617 coll $0buff 1;
#P newex 314 233 68 196617 prepend store;
#P newex 314 212 50 196617 zl join;
#P newex 314 191 50 196617 tosymbol;
#P newex 314 170 51 196617 zl slice 2;
#P comment 236 304 100 196617 if coll not empty;
#P comment 199 68 145 196617 1: empty coll , 2: delay active;
#P inlet 314 89 15 0;
#P inlet 553 146 15 0;
#P inlet 411 301 15 0;
#P outlet 195 755 15 0;
#P comment 526 388 170 196617 also sometimes , the filled coll does
not output from the bang-message…;
#P fasten 14 0 13 0 185 266 155 266 155 78 185 78;
#P fasten 17 0 13 0 412 420 127 420 127 67 185 67;
#P connect 13 0 12 0;
#P connect 12 0 14 0;
#P connect 25 0 1 0;
#P connect 14 1 1 0;
#P fasten 11 0 21 0 397 509 269 509 269 314 295 314;
#P connect 4 0 12 1;
#P connect 12 1 7 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 28 0;
#P connect 7 1 9 1;
#P connect 3 0 7 1;
#P connect 30 0 15 0;
#P connect 14 2 15 0;
#P connect 21 0 15 0;
#P connect 15 0 16 0;
#P connect 18 0 11 0;
#P connect 16 1 11 0;
#P connect 11 0 24 0;
#P connect 22 0 24 0;
#P connect 24 0 25 0;
#P connect 11 1 19 0;
#P connect 19 0 23 0;
#P connect 23 0 22 0;
#P connect 16 2 17 0;
#P connect 21 1 17 0;
#P connect 25 1 20 0;
#P connect 20 0 26 0;
#P connect 26 0 27 0;
#P connect 2 0 15 1;
#P connect 16 0 17 1;
#P connect 19 0 20 1;
#P connect 33 0 32 0;
#P connect 32 0 31 0;
#P connect 15 0 32 1;
#P pop;
#P newobj 269 390 90 196617 p ll.speedlim;
#P window linecount 2;
#P comment 170 95 187 196617 eg. speedlimiting incoming data from a
ctlin without loosing controler-states:;
#P connect 12 0 10 0;
#P connect 10 0 11 0;
#P connect 11 0 6 0;
#P connect 6 0 5 0;
#P connect 13 0 10 1;
#P connect 11 0 4 0;
#P connect 4 0 3 0;
#P connect 15 2 16 0;
#P connect 16 0 17 0;
#P connect 15 1 16 1;
#P connect 16 1 17 1;
#P connect 15 0 16 2;
#P connect 16 2 17 2;
#P connect 17 0 1 0;
#P connect 3 0 1 0;
#P connect 5 0 1 0;
#P connect 1 0 14 0;
#P connect 7 0 1 1;
#P connect 9 0 1 2;
#P pop;

#24694

You must be logged in to reply to this topic.