Forums > MaxMSP

Messege Objekt

October 10, 2009 | 11:10 pm

Hello

Lets say that you have a message-object look like:

[1 $1 5 $1 7 $1 9 $1]

and you want to change the number whithout typing directly in to the message.

Instead you want to do it by the number-object.
How do you solve this?

‘I am using ver 4.6.

/Fredrik


October 11, 2009 | 5:40 am

You should have it working now. Just take the left output of the numberbox into the messagebox, and connect the output of the messagebox to a "print". What’s not working?


October 11, 2009 | 7:50 pm

Hmmm.. I want to change numbers 1 , 7 and so On.
$1 is for another function.

/Fredrik


October 11, 2009 | 8:21 pm

Maybe I misunderstand something here, but you can have upto 9 changeable arguments in a messagebox. [1 $1 5 $1 7 $1 9 $1] can be [$2 $1 $3 $1 $4 $1 $5 $1]

The arguments must be sent as a list into the messagebox. Use [pak] or [pack] to generate the list.

Post a patch of what you’re trying to do, if this doesn’t help.


October 11, 2009 | 9:21 pm

Why don’t you just use a pack (or pak) object?

Pack (and pak) retain the state of each inlet between output. So write something like this? (Salt to taste, or tell us what you’re actually trying to do)

#P window setfont "Sans Serif" 24.;
#P number 366 363 77 24 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 366 340 245 196617 expr $i1 + $i2 – $i3 * $i4 – $i5 + $i6 +$i7 + $i8;
#P window linecount 2;
#P comment 109 267 100 196617 What do you want to do with the list?;
#P window linecount 1;
#P newex 349 265 27 196617 t b l;
#P window linecount 0;
#P message 366 317 78 196617;
#P window linecount 1;
#P newex 366 290 64 196617 prepend set;
#P window linecount 0;
#P message 263 291 78 196617;
#P window linecount 1;
#P newex 263 264 64 196617 prepend set;
#P newex 222 263 33 196617 print;
#P window linecount 2;
#P comment 434 118 100 196617 Sets 3rd , 5th , 7th elements , no output;
#P number 402 168 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 374 132 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 135 132 64 196617 prepend set;
#P number 135 112 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 222 88 27 196617 t b i;
#P window setfont "Sans Serif" 24.;
#P number 222 41 77 24 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 222 228 130 196617 pack 1 0 5 0 7 0 9 0;
#P window linecount 3;
#P comment 313 43 100 196617 Sets 2nd , 4th , 6th & 8th element and triggers output;
#P window linecount 2;
#P comment 10 121 100 196617 Sets 1st element , no output from pack;
#P window linecount 1;
#P comment 466 319 170 196617 Some useful formula , for example;
#P connect 19 0 20 0;
#P connect 16 0 19 0;
#P connect 3 0 12 0;
#P fasten 3 0 13 0 227 252 268 252;
#P fasten 3 0 17 0 227 252 354 252;
#P fasten 17 0 16 0 354 309 371 309;
#P connect 17 1 15 0;
#P connect 15 0 16 0;
#P connect 13 0 14 0;
#P connect 10 0 3 6;
#P connect 9 0 3 4;
#P connect 8 0 3 2;
#P connect 5 1 3 1;
#P fasten 5 1 3 3 244 111 278 111;
#P fasten 5 1 3 5 244 110 312 110;
#P fasten 5 1 3 7 244 109 346 109;
#P connect 7 0 3 0;
#P connect 6 0 7 0;
#P connect 5 0 3 0;
#P connect 4 0 5 0;
#P window clipboard copycount 21;


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