Forums > MaxMSP

Argument #0 – I didn't know that

May 5, 2006 | 12:41 pm

I’m using #0 extensively in a new project to create unique send/receive and
coll objects within instances of a patch. I discovered something new to me
by accident. (I know, it’s probably in the manual.) :-)

It goes like this. #0 gets replaced bt a unique 4-digit number that can be
used as part of the name for something created in a patch. It turns out
that the same number is passed down to any subpatches created with the
patcher object or encapsulation.

I guess I am just getting old but things like this make me happy – like a
cookie and warm milk.

Make a new folder. Name this firehose and save it to that folder.

#P outlet 202 182 15 0;
#P inlet 235 41 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 345 85 58 196617 r $0water;
#P newex 345 129 48 196617 s $0fire;
#P connect 1 0 0 0;
#P pop;
#P newobj 236 119 63 196617 p putoutfire;
#P number 234 181 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 294 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 237 89 58 196617 s $0water;
#P newex 233 145 48 196617 r $0fire;
#P connect 0 0 6 0;
#P connect 0 0 3 0;
#P connect 5 0 1 0;
#P connect 2 0 1 0;
#P window clipboard copycount 7;

Name this fireman and then put it in the same folder.

#P window setfont "Sans Serif" 9.;
#P number 199 169 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 201 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 200 137 47 196617 firehose;
#P connect 0 0 2 0;
#P connect 1 0 0 0;
#P window clipboard copycount 3;

When you open fireman, firehose and it’s subpatcher get the same number in
place of #0.

NOTE: This doesn’t work if the subpach "putoutfire" is saved as a separate
file.

Cheers,
Gary Lee Nelson
TIMARA Department
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


May 5, 2006 | 2:55 pm

Indeed.

However, I wouldn’t put money on the assumption that the ID number is
always going to be four digits. They do currently appear to start at
1000, so 8999 patchers later you’ll be in trouble.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


May 7, 2006 | 9:57 pm

Nick Rothwell wrote:
> However, I wouldn’t put money on the assumption that the ID number is
> always going to be four digits. They do currently appear to start at
> 1000, so 8999 patchers later you’ll be in trouble.

lost, I remeber I did a test, it will go on with 5 digit numbers.

The behaviour Gary describes has been there forever, its the same with
#1..#9 arguments in a [p ] they remain the same as in the main patcher.

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09


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