Forums > MaxMSP

Number of outlets set by the argument: C-coding.

August 26, 2013 | 10:31 am

Hello C-programmers,

I am making some objects in C and was wondering how does one go about creating an object with number of outlets set by the objects’ argument. The example of such object is [gate] where the argument sets the number of outlets. Since the pointers to the outlets are in data structure part of the code it seems like the maximum number of outlets has to be hardcoded. Is this the case? I noticed that [gate] can have up to 100 outlets, does this mean that there are 100 pointers created in the typedef struct and then in the new instance routine you create actual outlets up to that number?



August 26, 2013 | 10:56 am


for example, by creating an array of voids, for which you would allocate memory in the instance creation routine and free it in the instance destruction routine. Then you can use this array to store and refer to your outlets.

BTW, you’re on the wrong forum…


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