Socket connection: Python/Supercollider communication

If having the OSC ports conflict is what you are trying to avoid, you can make your own version of UniqueID that allocates OSC ports, then use this to assign all the OSC ports that Python sends to. This way, you will not have any conflicts from different instances.

I made this class:

NN_Synth_ID {

classvar <id=5000;

*initClass { id = 5000; }

*next  { ^id = id + 1; }

*path {this.filenameSymbol.postln}

}

then I use this to allocate NetAddr receive ports. Since each port has a unique port number, the messages (coming from 32+ different Python instances) don’t interfere with one another. You would need to modify your older code to use this, but since you are already doing this kind of work, it shouldn’t be too difficult.

Sam

1 Like