Making a Buffer~ unique to a patcher

benb7760's icon

Is there a way to make a buffer~ object only accessible from the patcher its in and its children?
so if i had a patcher loaded into a p object, and it contained a buffer, the parent cannot access the buffer but the patcher it was created in can

Emmanuel Jourdan's icon

Use the magic #0 in the buffer name (like buffer~ #0_toto). A unique random number will be generated (like 1074_toto) in place of the pound 0.

benb7760's icon

thank you for this advice. I am now facing a problem with this. I am making an MSP java that needs to access a buffer in the patcher that has been named this way. Is this achievable?

EMV's icon

Let the patcher output the unique name by connecting [loadbang]-[message #0_toto]-[outlet].
That way something outside the patcher receives the name and can access the buffer.