dynamically resizing pack object

Jul 4, 2007 at 10:20pm

dynamically resizing pack object

I’ve searched for this topic, but can’t find any info.

Is there any way to create a new pack object by specifiying its size rather than by a series of numbers?

I would like to be able to “resize” it by deleting the current one and then creating a new one of the desired size and making all the necessary connections using the js. object.

Problem is, even when creating a new one using javascript, you need to list the arguments separated by commas. As far as I can tell, I can’t take a list as an argument. So how can I just take a size argument and generate a pack?

#32754
Jul 5, 2007 at 12:12am

Hi.
This is not JS but it may give you some ideas.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 83 230 57 9109513 prepend set;
#P newex 35 133 106 9109513 t b i i;
#P objectname mypak[2];
#P number 35 102 35 9 0 0 64 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 83 185 14 9109513 0;
#P newex 83 206 58 9109513 zl group;
#P objectname mypak[1];
#P newex 83 276 38 9109513 append;
#P message 35 254 139 9109513 newex 169 147 55 9109513 pak;
#N thispatcher;
#Q end;
#P newobj 83 300 54 9109513 thispatcher;
#P objectname pak[1];
#P newex 83 161 40 9109513 uzi;
#P objectname mypak;
#P connect 7 0 2 0;
#P connect 7 1 0 0;
#P connect 7 2 4 1;
#P connect 6 0 7 0;
#P connect 8 0 3 0;
#P connect 4 0 8 0;
#P connect 3 0 1 0;
#P connect 2 0 3 0;
#P connect 5 0 4 0;
#P connect 0 0 5 0;
#P window clipboard copycount 9;

#108269
Jul 5, 2007 at 3:19am

thanks, but I can’t seem to open the patch. I added a max v2; to the top, but it still wont open.

#108270
Jul 5, 2007 at 3:57am

Things around here are simpler than that — just drag over all the lines starting with #P, copy them, then select “New from Clipboard” in MAX’s File menu. Voila.

Max patchers sorta co-exist as text files, making them ultra-easy to transport. You can Select All your objects in a patcher, go to any text program, and paste it.

#108271
Jul 5, 2007 at 7:53am

Murray Doodman schrieb:
> Is there any way to create a new pack object by specifiying its size
> rather than by a series of numbers?

I have a packer and unpacker abstraction which does that, its using
scripting to do its magic. You might want to look at it and maybe move
the scripting parts into your js… (Its in the abhaXions, which can be
downloaded with the St.ools from cycling74/share…)

Stefan


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

#108272
Jul 6, 2007 at 7:59pm

thanks people. The first approach mentioned works perfectly. I initially tried with zl join, but I need something that behaves exaclty like pack, whereas with the zl join approach I get problems with propagation. (don’t feel like going into detail..)

#108273

You must be logged in to reply to this topic.