Variables names in send/recieve objects? #0- something ish?

Sep 18, 2010 at 8:22pm

Variables names in send/recieve objects? #0- something ish?

i thought i remembered how to do that, but it looks like I don’t. i just want to be able to have multiple instances of my patches that all have sends and recieves in them without the instances talking to each other.
thanks!

#52376
Sep 18, 2010 at 9:04pm

this seems to become the number one FAQ on the max forums.

it should work to write [send 0#_blahblah] – but that wont help you much
when you want to connect to a [receive] in another patch.

for creating pairs of send/receive you need to make a little abstraction
and initialise the name to the send/receive, for example by

[loadbang]
[t #0_blahblah]
[prepend set]

and, last but not least: this wont work with [send], so you need to use [forward]

-110

#188256
Sep 18, 2010 at 10:00pm

@Roman

You’re quite right about this; despite having several years experience with MaxMSP, both practical and theoretical, and having gone through the documentation in detail, this is one aspect that seems to elude me. I often encounter patches built by others using 0#_whatever, in subpatches and abstractions where [poly~] is used. I try to copy the approach and it ‘doesn’t work’…

perhaps it belongs in the Arcana sticky

#188257
Sep 18, 2010 at 11:32pm

these problems are usually releated to load order.

which is why i recommend to get the #0_ from “outside” instead of typing it as argument.

for poly, forward/receive, or play/buffer you need to do it like this anyway.

#188258
Sep 19, 2010 at 2:58pm

right on, thanks. how do I name a buffer in a way that will work similarly? I mean I’m not trying to build anything polyphonic necessarily, but i have a patch that records audio into a buffer and reads it back with numbers being sent all over, and i want it to be all contained so that if i open the same patcher again, just another window, they wont be talking to each other at all and will be reading only from their own buffer. how do i does it?!

#188259
Sep 19, 2010 at 8:02pm

exactly the same way:

[loadbang]
[t #0_blahblah]
[prepend set]

and then conect this to both, BOTH, your buffer and your play object.

to make 100% sure that the audio objects do not come across (which could
happen if audio is running already when you load another instance of the
patcher with the buffer) you could give the buffer a #0_blubblub name in addition.

i dont do this, it is a bit confusing because now the buffer shows a name which
does not match its actual status. i use [buffer~ noname] or something like that to
visualize that its name is set from outside or by a loadbang.

if you use an abstraction you might encounter situations where right to left order
suddenly makes a difference; i would not like to initialise objects like waveform~
or buffer~ from a subpatch, it is safer to have the loadbang on the same level or
above.

attached a simple example for the creation of unique names a la “1688drumsampler”
where there is no loadbang in the abstraction for that reason.

you use it like this:

[loadbang]
[110.unisym blahblah]
[prepend set]
[buffer~ setme] and [play~ setme]

-110

Attachments:
  1. 110.unisym.zip
#188260

You must be logged in to reply to this topic.