Max API question

njazz's icon

Hello
Is there a way to create an external object that acts as [receive] object? I thought that globalsymbol_bind() would work that way but didn't get the expected result

Thanks!

ecuk's icon

The SDK has a set of functions that appear to be for the kind of broadcast notification mechanism used by [send] and [receive]. I am not sure whether or not these are what the internal objects actually use, but they do appear to be functionally similar. Look under ‘Modules » Objects’ in the SDK docs for functions such as object_register, object_attach, object_subscribe and (especially) object_notify.

I must admit that I have never used these functions, but I am hoping that this will point you in the direction you want to go. For my own purposes, good ol’ [send] and [receive] placed after/before my own external objects have always been good enough.

njazz's icon

thanks for your message

i've tried these object_register-object_notify functions but it seemed for me that it's for some kind of different mechanism. will check that further

what i've found so far is that globalsymbol_bind actually works with the symbol 'smth' as in [send smth], but the bound object is some kind of "through" class that is a CLASS_NOBOX object and i have yet no ideas what can be done with that (it actually has an outlet and it works if i output data with oultet_[anything](), i can imagine the [send] implementation but not the [receive])

yes, for now will keep it this way with separate "send/receive"

ecuk's icon

Cool. Like I said, I hadn’t really looked at this, so thank you for sharing what you have found to be happening internally. I have always suspected that [send]/[receive] are rather low-level internal functionality provided by the core language, something like magical patch-cords. I believe that one of the early Miller Puckette papers mentions it briefly, but I do not recall there being much said about how it actually works internally. (And no doubt things have changed in the many years since.)

If you discover anything further, please come back and share it.

achzo's icon

Check master and servant examples in sdk

njazz's icon

@Achzo thanks, yes, i've missed that a bit - this really seems to be the exact answer though i didn't manage to make this to work with standard send/receive objects, just with my custom ones

So far i'll keep it all more simple with just Max objects for sending/receiving. If i get more info on that i'll post it here

Thanks for your replies

Regards,
Alex