Sending clientID to OSC port

I can't seem to find any references to this, but apologies if it's been asked, answered, or documented and I haven't found it.

Is there a way for the clientID to be sent alongside the other OSC messages to a port?

I have a session in SuperCollider that I want to control using many different devices. Although I specify a clientID in the URL when accessing the Open Stage Control server (for example, I don't know how to send that clientID to SuperCollider so that it can read messages only from that specific clientID.

Thanks in advance!

I'm not sure that's possible, maybe the best way is to custom the osc message for each client ?

Ideally I wanted each client to load the same .json file, so that regardless of how many people are connected to the server, I can filter the incoming messages based on their clientID, and not create separate .json files with different widgets.

Unless there is a way to custom the osc messages for each client, while all of them are using the same .json file, that I am not aware of.

You could append the client id to all outgoing messages using a custom module:

module.exports = {
  oscOutFilter: function(data) {
      type: 's',
      value: data.clientId
    return data

Note that all clients must have different ids.

1 Like

While running the custom module you sent, I get a "TypeError: data.args.append is not a function" error :confused:

Sorry, I got JS and Python mixed up for a moment, should be push instead of append (post edited).

Thank you! That worked!