Forums > MaxMSP

scripting bug?

March 18, 2007 | 5:09 am

Hi all,
I’ve been trying to create a new "send" object with scripting and thispatcher but i just can’t seem to get it to work. Most other things i try and create (leds, numberboxes, sliders and so on) work just fine. I’ve tried various different syntax orders for send, but still no luck.

can anyone help?

max v2;
#N vpatcher 243 217 488 343;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 26 55 199 9109513 script new Atrack send atrack 72 218 313 335;
#N thispatcher;
#Q end;
#P newobj 26 77 54 9109513 thispatcher;
#P connect 1 0 0 0;
#P pop;

cheers,
Adamxo


March 18, 2007 | 10:12 am

try this:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 67 49 243 9109513 script new blabla newex 153 145 55 9109513 send
blabla;
#N thispatcher;
#Q end;
#P newobj 67 79 54 9109513 thispatcher;
#P connect 1 0 0 0;
#P window clipboard copycount 2;

best


March 18, 2007 | 10:56 am

a little explanation of what you see for this send object when you edit the
patch as text:

"script new bloblo newex 153 145 55 9109513 send blabla;"

== script new "send object name" newex "X coord" "Y coord" "object
length"9109513 send "send
argument"

"9109513 send" should be the send-object-as-text-format you see in text
patch.

here’s an example:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 373 171 86 9109513 script delete bloblo;
#P comment 186 45 100 9109513 create;
#P comment 320 81 100 9109513 object length;
#P comment 186 81 100 9109513 Y coord;
#P button 169 44 15 0;
#P newex 303 124 27 9109513 i;
#P newex 169 123 27 9109513 i;
#P newex 35 123 27 9109513 i;
#P number 52 99 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 186 99 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 320 99 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N thispatcher;
#Q end;
#P newobj 35 189 54 9109513 thispatcher;
#P newex 35 147 278 9109513 sprintf script new bloblo newex %ld %ld %ld
9109513 send blabla;
#P comment 52 81 100 9109513 X coord;
#P connect 13 0 2 0;
#P fasten 9 0 6 0 174 118 40 118;
#P connect 9 0 7 0;
#P fasten 9 0 8 0 174 118 308 118;
#P connect 6 0 1 0;
#P connect 7 0 1 1;
#P connect 8 0 1 2;
#P connect 3 0 8 1;
#P connect 4 0 7 1;
#P connect 5 0 6 1;
#P connect 1 0 2 0;
#P window clipboard copycount 14;


March 19, 2007 | 6:28 pm

That’s a cool patch and was pretty informative. When making lots of these, you’d want a way to change the object name (only the most recently-created object is named "bloblo", the previous ones get reset to . An easy addition.

Fiddle with the 9109513 number… it’s a code that cycles through all the system fonts and fontsizes. Try changing it around a bit and see what you get, it’s interesting. Wonder if there’s a reference list for this somewhere.

-CJ


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