External Building: Send an array out an outlet as a list.


    Apr 27 2016 | 4:57 pm
    Hi all,
    I may be missing something simple, but I can't seem to figure this out from the API documentation or any online search. I want to send an array of integers out the outlet of an external as a list, eg - a message box will receive a list of individual integers all at once. I thought I had it, but it seems that my list is actually just a repetition of a single item from the list - the first value held in the array.
    If at all possible, could someone please explain how I can get something like this: myArray[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; to be dumped out an outlet so that a message box connected to that outlet will show this: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15?
    As I said, this could be really obvious once I see it, but I'm only beginning to venture into building externals and despite C itself being relatively familiar, this is really confusing the hell out of me.
    Thanks.

    • Apr 28 2016 | 7:34 am
      Thanks for the response. Nevermind being an 'expert', whatever it was, you kicked something loose in my head and I have it solved now. So thanks again for that.
      It turns out that I had a combination of problems - not least of which was an error in my loop. The other was just some 'atom' typing confusion. Anyway, my first proper (not built out of a book) external is working. Happy days.
    • Dec 17 2017 | 5:39 pm
      I'm trying to do this same thing, what I don't understand is how to actually allocate the t_atom array dynamically? So in the object struct I should probably have t_atom atomList; And according to this Max api documentation probably use this atom_alloc_array : https://cycling74.com/sdk/MaxSDK-7.1.0/html/group__atom.html#ga5601306b4b76f338501cda586a6c1fde but that doesn't really make sense to me, like what to do to reallocate/resize? How did you end up doing it Tristan? I think that atom_setlong_array makes sense but I don't understand the allocation process. Thanks!