I am sending OSC messages from Supercollider to Processing. I want to use the OSC messages to populate two arrays storing x and y coordinates for certain shapes. My idea was to send three messages: an index, an x position, and a y position. The index would indicated where to populate the x and y in the array.
My ideas was to use global variables (x,y,index) that the OSC message would change. I can, however, see a flaw with this idea. If two OSC messages are sent at the same time it could cause a conflict. In addition, something feels wrong about my whole approach. I’m not sure if using global variables is the correct approach.
Does anyone have insight or experience into this? Thank you in advance for any help!
I’ll preface this by saying that I know nothing about OSC.
The three messages idea seems bad – is there any guarantee that the messages will arrive in the same order as they were dispatched (does your code handle this possibility?).
Could you pack the index, x and y into a single (32 bit?) integer so as to deal with everything in one message? If the index, x and y ranges can’t be represented as fields that fit into an integer frame then format the message as a BLOB and deliver all of the data in one block.