Forums > MaxMSP

Possible to know if an outlet is connected or no?

December 4, 2012 | 1:32 am

hi

All is in the title I think,

have a nice day,

xxx


December 4, 2012 | 7:51 am

Technically "yes" but it involves feeding the JSON of the patch into itself to parse. There might be a better method so why do you need to know? And are you checking for a Max connection or an MSP connection?


December 4, 2012 | 6:40 pm

Well, are you talking about from within an external (in C), or via Javascript or Java or by patching?

The C API does not provide for this. You can try to hack the outlet data structure, but that’s playing with fire and anything you figure out today is likely to break in the next release or two (or sooner).

Standard question: why do you need to know? If you need to know, you’re not thinking OO.


December 11, 2012 | 2:01 pm

I was needing to know for optimisation, avoid some treatment if that’s useless because i don’t use the outlet.
thank for your answer : )


December 11, 2012 | 3:06 pm

What you can do (and relatively easily) is let the user specify at instantiation time (ie, with an argument) whether the outlet is needed.

This would be a similar strategy to [route] and [sel] where the user specifies how many outlets to create via instantiation arguments. If the user doesn’t create the outlet, it doesn’t need to be calculated.

This is probably not the flexibility you were hoping for, but it might be a strategy worth considering.


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