Page 1 of 1

How to receiveg huge OSC arrays

Posted: 05 Jan 2017 15:58
by AkaMed
Hello

I am trying to receive a packet from Ableton Live. It contains all the clip names, so I can be easily 1024 indexes.
I can't put OSC_ARGS in a vector, because the if the full message was received, it would be 1024, and it is more than the 256 indexes Lemur limit.
So I have to call oscout several times to get all the clips on each track, so each track would be a vector that contains all the clip names of the track.
The problem is that I am not able to pause the script between tracks, so that I can receive each track in the same script.

I.E:

oscout(/live/name/clipblock,0,0,0,16)
(wait until the receive script has finished receiving OSC_ARGS and assigning them to the vector Track0)

oscout(/live/name/clipblock,1,0,0,16)
(wait until the receive script has finished receiving OSC_ARGS and assigning them to the vector Track1)

oscout(/live/name/clipblock,2,0,0,16)
(wait until the receive script has finished receiving OSC_ARGS and assigning them to the vector Track2)

...etc

The receive script is the same for all the calls but assigns each reception to the corresponding vector, so it workis fine
...the problem is that I am not able to pause the send script.

Any ideas?

Re: How to receiveg huge OSC arrays

Posted: 06 Jan 2017 14:26
by oldgearguy
without having Lemur in front of me to test these theories, I can only throw out an idea or two...

If the send script set a global variable (like DONE) to 0, then called oscout() and waited until the receive script finished and set it to 1, would that work?

Putting in a pure delay (like with the internal time() call compared to some time of now+ a delta) or using a midi_clock as a timer could result in the send triggering before the receiver has actually finished. You need a synchronization mechanism to make sure it is done.

The other non-obvious way is to have the send() start things, then the first receiver task calls the next send() when it's done receiving and so on.