? Pd style $0 arguments

ocannon's icon

Hi list !

My copy of MaxMSP just authorized this morning and I've spent the day
adapting from Pd. I've been searching tutorials and MaxMSP forum for
a convention like Pd's $0. In Pd, $0 used as part of an obj's
creation argument within a subpatch (ie. named send or receive) is
replaced with a random number. This allows several subpatches to
maintain their own namespace without recoding. Tried #0, to no avail.
Incidentally, I can't get #1, #2, ... to work either, I'd come across
mention of this convention on MaxMSPForums.

pdelges's icon

On 21 sept. 07, at 10:41, Owen Cannon wrote:

> My copy of MaxMSP just authorized this morning and I've spent the day
> adapting from Pd. I've been searching tutorials and MaxMSP forum for a
> convention like Pd's $0. In Pd, $0 used as part of an obj's creation
> argument within a subpatch (ie. named send or receive) is replaced
> with a random number. This allows several subpatches to maintain their
> own namespace without recoding. Tried #0, to no avail. Incidentally, I
> can't get #1, #2, ... to work either, I'd come across mention of this
> convention on MaxMSPForums.

#0-#9 have to be at the beginning of symbols, so for instance [receive
#1_foo] works, but [send bar#0] won't.

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl
http://www.crfmw.be/max

volker böhm's icon

>
> My copy of MaxMSP just authorized this morning and I've spent the
> day adapting from Pd. I've been searching tutorials and MaxMSP
> forum for a convention like Pd's $0. In Pd, $0 used as part of an
> obj's creation argument within a subpatch (ie. named send or
> receive) is replaced with a random number. This allows several
> subpatches to maintain their own namespace without recoding. Tried
> #0, to no avail. Incidentally, I can't get #1, #2, ... to work
> either, I'd come across mention of this convention on MaxMSPForums.

hi,
the #-stuff only works in abstractions. i.e. save your subpatch
somewhere max can find it and load it into your main patch.
afaik #0 also needs some additional random string concatenated, like
#0yuyur.
*-vb

/* save as myAbstr.mxb */

Max Patch
Copy patch and select New From Clipboard in Max.

/* main patch */

Max Patch
Copy patch and select New From Clipboard in Max.