Forums > MaxMSP

BPatcher – Limited Number of 'Arguments to Patcher'

April 13, 2007 | 2:24 am

In bpatchers, there’s a limie of 10 total "arguments to patchers", right? Any way around that? e.g., If I have 6 named attributes, how can I address all 6 with a bpatcher?

Thanks.

Adam


April 13, 2007 | 6:24 am

Hi Adam,

Maybe this doesn’t help you but I can get a kajillion named variables to a bpatcher with just a couple # arguments. Did I say that right? But this is what I thought you actually explained to me the other week. I made special demo patches for you.

The top level patch:

#P toggle 373 32 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 370 66 58 196617 metro 250;
#P newex 368 93 64 196617 random 127;
#P slider 369 123 15 128 0 1;
#P newex 368 269 277 196617 bucket 20;
#P number 694 501 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 680 525 37 196617 s Bx;
#P number 652 502 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 605 502 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 562 502 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 522 501 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 476 503 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 420 502 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 369 502 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 319 504 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 267 506 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 638 526 40 196617 s Bix;
#P newex 589 527 46 196617 s Bviii;
#P newex 544 527 43 196617 s Bvii;
#P newex 450 528 37 196617 s Bv;
#P newex 493 527 40 196617 s Bvi;
#P newex 405 526 40 196617 s Biv;
#P newex 358 527 40 196617 s Biii;
#P newex 308 531 37 196617 s Bii;
#P newex 265 532 34 196617 s Bi;
#P number 697 419 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 691 444 37 196617 s Ax;
#P comment 187 512 65 196617 $2 bank;
#P number 659 420 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 613 419 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 570 419 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 530 418 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 484 420 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 428 419 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 377 419 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 327 421 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 275 423 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 649 445 40 196617 s Aix;
#P newex 605 445 46 196617 s Aviii;
#P newex 560 445 43 196617 s Avii;
#P newex 466 446 37 196617 s Av;
#P newex 509 445 40 196617 s Avi;
#P newex 421 444 40 196617 s Aiv;
#P newex 374 445 40 196617 s Aiii;
#P newex 324 449 37 196617 s Aii;
#P newex 281 450 34 196617 s Ai;
#P comment 196 437 46 196617 $1 bank;
#P bpatcher 166 598 646 221 0 0 sub_bpatcher 0 A B;
#P connect 47 0 46 0;
#P connect 46 0 45 0;
#P connect 45 0 44 0;
#P connect 44 0 43 0;
#P connect 43 19 42 0;
#P connect 43 18 40 0;
#P connect 43 17 39 0;
#P connect 43 16 38 0;
#P connect 43 15 37 0;
#P connect 43 14 36 0;
#P connect 43 13 35 0;
#P connect 43 12 34 0;
#P connect 43 11 33 0;
#P connect 43 10 32 0;
#P connect 43 9 22 0;
#P connect 43 8 19 0;
#P connect 43 7 18 0;
#P connect 43 6 17 0;
#P connect 43 5 16 0;
#P connect 43 4 15 0;
#P connect 43 3 14 0;
#P connect 43 2 13 0;
#P connect 43 1 12 0;
#P connect 43 0 11 0;
#P connect 32 0 23 0;
#P connect 33 0 24 0;
#P connect 34 0 25 0;
#P connect 35 0 26 0;
#P connect 36 0 28 0;
#P connect 37 0 27 0;
#P connect 38 0 29 0;
#P connect 39 0 30 0;
#P connect 40 0 31 0;
#P connect 42 0 41 0;
#P connect 22 0 21 0;
#P connect 19 0 10 0;
#P connect 18 0 9 0;
#P connect 17 0 8 0;
#P connect 16 0 6 0;
#P connect 15 0 7 0;
#P connect 14 0 5 0;
#P connect 13 0 4 0;
#P connect 12 0 3 0;
#P connect 11 0 2 0;
#P window clipboard copycount 48;

AND a nested bpatcher, named "sub_bpatcher":

#P window setfont "Sans Serif" 9.;
#P number 520 149 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 518 122 37 196617 r $2x;
#P number 478 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 431 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 388 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 348 149 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 302 151 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 246 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 195 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 145 152 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 93 154 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 476 123 40 196617 r $2ix;
#P newex 427 124 46 196617 r $2viii;
#P newex 382 124 43 196617 r $2vii;
#P newex 288 125 37 196617 r $2v;
#P newex 331 124 40 196617 r $2vi;
#P newex 243 123 40 196617 r $2iv;
#P newex 196 124 40 196617 r $2iii;
#P newex 146 128 37 196617 r $2ii;
#P newex 103 129 34 196617 r $2i;
#P number 522 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 520 66 37 196617 r $1x;
#P comment 14 124 65 196617 $2 bank;
#P number 484 94 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 438 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 395 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 355 92 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 309 94 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 253 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 202 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 152 95 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 100 97 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 478 67 40 196617 r $1ix;
#P newex 434 67 46 196617 r $1viii;
#P newex 389 67 43 196617 r $1vii;
#P newex 295 68 37 196617 r $1v;
#P newex 338 67 40 196617 r $1vi;
#P newex 250 66 40 196617 r $1iv;
#P newex 203 67 40 196617 r $1iii;
#P newex 153 71 37 196617 r $1ii;
#P newex 110 72 34 196617 r $1i;
#P comment 36 94 100 196617 $1 bank;
#P connect 20 0 21 0;
#P connect 40 0 41 0;
#P connect 9 0 18 0;
#P connect 30 0 39 0;
#P connect 8 0 17 0;
#P connect 29 0 38 0;
#P connect 7 0 16 0;
#P connect 28 0 37 0;
#P connect 5 0 15 0;
#P connect 26 0 36 0;
#P connect 6 0 14 0;
#P connect 27 0 35 0;
#P connect 4 0 13 0;
#P connect 25 0 34 0;
#P connect 3 0 12 0;
#P connect 24 0 33 0;
#P connect 2 0 11 0;
#P connect 23 0 32 0;
#P connect 1 0 10 0;
#P connect 22 0 31 0;
#P window clipboard copycount 42;


April 13, 2007 | 6:29 am

The board’s not letting me edit my reply….. in case you didn’t catch it the arguments in the get info of the bpatcher are: A B


April 13, 2007 | 12:50 pm

Quote: Bradford Reed wrote on Fri, 13 April 2007 00:24
—————————————————-
> Hi Adam,
>
> Maybe this doesn’t help you but I can get a kajillion named variables to a bpatcher with just a couple # arguments. Did I say that right? But this is what I thought you actually explained to me the other week. I made special demo patches for you.
>

I probably wasn’t clear in my explanation. You’re entering two arguments and distributing them to multiple objects. My problem is how many pieces of information a bpatcher actually allows in the "Arguments to Patcher" window. If I have 6 named attributes, that means I need to enter 12 pieces of information into "Arguments to Patcher". However, it seems bpatchers only allow a total of 10 discrete symbols, ints, etc., in "Arguments to patcher".

I’m attaching two files to illustrate my point.

My guess is there’s no way around this. I posted to make sure I wasn’t missing anything really obvious.

Save this as _bottom_patch

max v2;
#N vpatcher 651 255 1251 655;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 223 270 39 196617 print $1;
#P newex 192 191 160 196617 route george dick hillary rudy john al;
#P newex 146 152 57 196617 patcherargs;
#P connect 0 1 1 0;
#P connect 1 0 2 0;
#P connect 1 1 2 0;
#P connect 1 2 2 0;
#P connect 1 3 2 0;
#P connect 1 4 2 0;
#P connect 1 5 2 0;
#P pop;

Save this as _top_patch

max v2;
#N vpatcher 15 55 615 455;
#P bpatcher 189 174 250 183 -132 -138 _bottom_patch.mxt 1 this_works_NOT @george mccain @dick clinton @hillary guiliani @rudy gore @john;
#P window setfont "Sans Serif" 9.;
#P window linecount 6;
#P comment 81 172 100 9109513 This isn’t ok. Inspect to see how info disappears — Only 10 individual symbols (using that term right?) are allowed;
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P newex 58 109 249 196617 _bottom_patch this_works @george mccain @dick clinton @hillary guiliani @rudy gore @john bush @al cheney;
#P window linecount 1;
#P comment 57 88 100 196617 This is ok;
#P pop;


April 24, 2007 | 2:23 pm

Adam Kendall schrieb:
> My guess is there’s no way around this. I posted to make sure I
> wasn’t missing anything really obvious.

It’s a known issue, I reported it and complained. Its a bad limitation.
The same applies for arguments to poly~ and pfft~ (patcherargs doesn’t
work inside at all in poly~ ans pfft~…)

I hope at least Max 5 will fix these issues.

But in terms of work around, there is always a workaround. If you pass
the attributes as a single symbol, you can pass it, but this is really
ugly and you have to retrieve it yourself afterwards….

Its probably better to send them with a loadmess into one of the inputs
of your bpatcher…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


April 24, 2007 | 9:13 pm

Hi, Stefan,

That changes the timing of when the info is received, which was one reason I wanted to use the named attributes. Same issue with using numbered arguments managing with loadmess. But, yeah, point taken — Workaround necessary.

Quote: Stefan Tiedje wrote on Tue, 24 April 2007 08:23
—————————————————-

> Its probably better to send them with a loadmess into one of the inputs
> of your bpatcher…
>
> Stefan


April 24, 2007 | 10:42 pm

>
> I probably wasn’t clear in my explanation. You’re entering two arguments and distributing them to multiple objects. My problem is how many pieces of information a bpatcher actually allows in the "Arguments to Patcher" window. If I have 6 named attributes, that means I need to enter 12 pieces of information into "Arguments to Patcher". However, it seems bpatchers only allow a total of 10 discrete symbols, ints, etc., in "Arguments to patcher".
>
> My guess is there’s no way around this.

limit of 10 means limit of 10 – not maybe 12.

not even if you say "oh please" to your bpatchers. :)

i have been doing the distribution trick too when i once needed
12 or 15 arguments – for example "255255255" split up into
r,g,b values inside using [route].

but after a while i found out it makes sometimes more sense
not to use bpatcher arguments at all.
doesnt it suck to open the inspector all the time?
since a while i only send messages from outside to bpatcher.
thats unlimited then, and it even works across different
bpatchers …

-110


April 25, 2007 | 2:25 am

What can I say, I like inspecting objects.

I also like writing objects that work as both bpatchers and patchers for situations where I do or do not need an interface. That’s where I’m getting into trouble.

Also, I really like how easy it is to set overridable default values with named attributes.

So, yeah, plenty of workarounds, but nothing as nice as if bpatchers allowed more than 10 elements.

Adam

Quote: Roman Thilenius wrote on Tue, 24 April 2007 16:42
—————————————————-
>

> but after a while i found out it makes sometimes more sense
> not to use bpatcher arguments at all.
> doesnt it suck to open the inspector all the time?
> since a while i only send messages from outside to bpatcher.
> thats unlimited then, and it even works across different
> bpatchers …
>


April 25, 2007 | 5:52 am

An option is to provide a single symbol as argument eg "a b c d … z" and fromsymbol that. The only slight nuisance is the next time you open the inspector the textedit object has removed the quotation marks.

_
johan


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