sprintf help?

Feb 17, 2010 at 12:30am

sprintf help?

good morning –

i’m using sprintf symout to create a particular message with let’s say 5 inputs. it all works fine. my issue has to do with a correction. if i use the 5 inputs and then need to recorrect using only 4 inputs, the 5th input still gets sent out. my question: how can i reset sprintf symout without closing / reopening my patch?

and i’m using max/msp 4.6 on a osx 10.4 laptop.

max v2;
#N vpatcher 492 84 1162 729;
#P window setfont “Sans Serif” 9.;
#P comment 513 375 100 196617 Reset;
#P message 507 460 22 196617 set;
#P button 507 396 49 0;
#P comment 121 56 100 196617 Second;
#P comment 422 59 100 196617 First;
#P newex 493 198 66 196617 t b b b b b;
#P button 508 281 49 0;
#P message 86 554 208 196617 1 1 176 2 2 186 3 3 191 4 4 134 5 5 141;
#P newex 86 525 62 196617 prepend set;
#P newex 86 490 64 196617 fromsymbol;
#P newex 326 433 51 196617 tosymbol;
#P newex 266 433 51 196617 tosymbol;
#P newex 206 433 51 196617 tosymbol;
#P newex 146 433 51 196617 tosymbol;
#P newex 86 433 51 196617 tosymbol;
#P newex 86 462 253 196617 sprintf symout %s %s %s %s %s;
#P message 266 390 48 196617 4 4 134;
#P message 146 390 48 196617 2 2 186;
#P window linecount 0;
#P message 326 308 53 196617;
#P window linecount 1;
#P message 206 308 48 196617 3 3 191;
#P message 86 309 48 196617 1 1 176;
#P number 418 79 35 9 0 360 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 190 78 14 196617 5;
#P message 162 78 14 196617 4;
#P message 137 78 14 196617 3;
#P message 111 78 14 196617 2;
#P message 86 78 14 196617 1;
#P newex 326 227 30 196617 t b b;
#P message 346 253 14 196617 5;
#P newex 326 279 103 196617 sprintf set %i %i %i;
#P message 326 253 14 196617 5;
#P newex 266 304 30 196617 t b b;
#P message 286 330 14 196617 4;
#P newex 266 354 103 196617 sprintf set %i %i %i;
#P message 266 330 14 196617 4;
#P newex 206 230 30 196617 t b b;
#P message 226 256 14 196617 3;
#P newex 206 280 103 196617 sprintf set %i %i %i;
#P message 206 256 14 196617 3;
#P newex 146 305 30 196617 t b b;
#P message 166 331 14 196617 2;
#P newex 146 355 103 196617 sprintf set %i %i %i;
#P message 146 331 14 196617 2;
#P newex 86 228 30 196617 t b b;
#P message 106 254 14 196617 1;
#P newex 86 280 103 196617 sprintf set %i %i %i;
#P message 86 254 14 196617 1;
#P newex 86 198 313 196617 select 1 2 3 4 5;
#P comment 505 258 100 196617 Final Message;
#P connect 26 0 1 0;
#P connect 25 0 1 0;
#P connect 24 0 1 0;
#P connect 23 0 1 0;
#P connect 22 0 1 0;
#P connect 1 0 5 0;
#P connect 5 0 2 0;
#P connect 2 0 3 0;
#P connect 47 0 28 0;
#P connect 43 0 28 0;
#P connect 3 0 28 0;
#P connect 28 0 34 0;
#P connect 34 0 33 0;
#P connect 33 0 39 0;
#P connect 39 0 40 0;
#P connect 40 0 41 0;
#P connect 5 1 4 0;
#P connect 4 0 3 1;
#P connect 1 1 9 0;
#P connect 9 0 6 0;
#P connect 6 0 7 0;
#P connect 47 0 31 0;
#P connect 43 1 31 0;
#P connect 7 0 31 0;
#P connect 31 0 35 0;
#P connect 35 0 33 1;
#P connect 9 1 8 0;
#P connect 27 0 3 2;
#P connect 8 0 7 1;
#P connect 1 2 13 0;
#P connect 13 0 10 0;
#P connect 10 0 11 0;
#P connect 47 0 29 0;
#P connect 43 2 29 0;
#P connect 11 0 29 0;
#P connect 29 0 36 0;
#P connect 36 0 33 2;
#P connect 13 1 12 0;
#P connect 27 0 7 2;
#P connect 12 0 11 1;
#P connect 1 3 17 0;
#P connect 17 0 14 0;
#P connect 14 0 15 0;
#P connect 47 0 32 0;
#P connect 43 3 32 0;
#P connect 15 0 32 0;
#P connect 32 0 37 0;
#P connect 37 0 33 3;
#P connect 17 1 16 0;
#P connect 27 0 11 2;
#P connect 16 0 15 1;
#P connect 1 4 21 0;
#P connect 21 0 18 0;
#P connect 18 0 19 0;
#P connect 47 0 30 0;
#P connect 43 4 30 0;
#P connect 19 0 30 0;
#P connect 30 0 38 0;
#P connect 38 0 33 4;
#P connect 21 1 20 0;
#P connect 27 0 15 2;
#P connect 20 0 19 1;
#P connect 27 0 19 2;
#P fasten 42 0 43 0 513 343 583 343 583 184 498 184;
#P connect 46 0 47 0;
#P pop;

#48527
Feb 17, 2010 at 1:09am

I’m not entirely sure what you’re trying to do here but perhaps you can achieve something similar with the [zl] object. I can’t remember which modes are new to max5 but maybe something with an [uzi] to generate you original lists and then collect them with [zl group]?

lh

#174541
Feb 17, 2010 at 1:14am

Don’t use sprinf to create lists.

pack and pak can be used to create lists of a fixed length, zl, prepend and append variable.

#174542
Feb 17, 2010 at 1:25am

i know it’s a bit complicated for what should be a very simple patch, but . . .

anyway, the point of this is to have a user-friendly way to generate what could be a large message to vbap. and it works, unless you need to change to a smaller speaker set up. any thoughts are welcome and appreciated!

and i will upgrade to max 5 at some point this year. thanks for any assistance you can give.

drew

#174543
Feb 17, 2010 at 1:47am

zl join is the closest zl i can use, but it only works with 2 lists. i need to continually add lists of items together. if i had one speaker, it’s 3 items; 16 speakers grows to 48 items. is there a zl not in the help file that works?

drew

#174544
Feb 17, 2010 at 10:00am

It’s time to make yourself an abstraction using multiple zl joins, I’m thinking….

#174545
Feb 17, 2010 at 8:26pm

thank you all! the several zl’s work as intended!

d

#174546

You must be logged in to reply to this topic.