An OSC 'SwitchToRack' question

Below is the TouchOSC layout file I was playing around with.
For the Pager control, I added two OSC message entries: one for receiving the rackspace index from my script, the other for sending the index back to GP. For each of those, I had ticked/unticked either the ‘Send’ or ‘Receive’ tick boxes, to match whether that message should only be sent or received.

SwitchRackspace.tosc.zip (2.5 KB)

Aha… this is the missing link…It hadn’t occurred to me to give the control a separate send and receive osc message! :roll_eyes:

Presumably, I will need to change/duplicate this script for every new IP address I find myself using in the same way as I have to redefine the OSC target IP and port?

By the way, I know I am both sending and receiving osc in TouchOSC (see the green blinking light top left? That’s a widget return from GP that is blinking as a result of a hidden control in TouchOSC with a butchered ping script (one of hexlers few example scripts) running. If it’s blinking, then I know I have two way connection. Not really necessary, but I managed to fiddle until that one worked in an effort to learn a little!

Thanks for all your help with getting to the answer, but also with a better definition of my question! Top work.

Actually, the script can be simplified down to this. Taking out any reference to the IP and Port means that it will use the entries you specify in the GP ‘Options > OSC Setup’. That way you only need to change things once, and the script is set-and-forget.

// Called when you switch to another rackspace
On Rackspace(oldRackspaceIndex : integer, newRackspaceIndex : integer)
    OSC_SendInteger("/CurrentRackspaceIndex", newRackspaceIndex)
End
2 Likes

even better!