Also make sure the server had been started with enough maxLogins (in ServerOptions). If you started the server with only one available login, then another sclang will not be able to connect to it. ok, you did that
This works when I do it interactively, but it still doesn’t produce any sound when I run it as a script:
Server.default.addr.port = 57110;
o = ServerOptions.new;
o.maxLogins = 100;
r = Server.remote(\myserver, NetAddr("127.0.0.1", 57110), o);
Server.default = r;
{SinOsc.ar([400, 404])}.play(r);
Here is the output:
❯ sclang a.sclang
compiling class library...
Found 850 primitives.
Compiling directory '/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary'
Compiling directory '/Users/evar/Library/Application Support/SuperCollider/Extensions'
numentries = 817296 / 11914364 = 0.069
5362 method selectors, 2222 classes
method table size 13037592 bytes, big table size 95314912
Number of Symbols 12022
Byte Code Size 360460
compiled 322 files in 1.00 seconds
compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Class tree inited in 0.02 seconds
*** Welcome to SuperCollider 3.11.0. *** For help type cmd-d.
myserver : setting clientID to 0.
WARNING: server 'myserver' not running.
Requested notification messages from server 'myserver'
myserver: server process has maxLogins 128 - adjusting my options accordingly.
myserver: keeping clientID (0) as confirmed by server process.
I tried r.waitForBoot{ {SinOsc.ar([400, 404])}.play }; but this kills the server and starts a new one.
AFAICS in the code, this shouldn’t happen in the class library.
What is the highest client ID you’re actually being assigned? Look for a message like “setting clientID to (number).”
Btw maxLogins shouldn’t be > 32. Currently it allows you to set maxLogins = 100 but once you get past clientID 31 (the 32nd user) you’ll get an error from the node ID allocator.
For posterity: If maxLogins > 32, sclang will produce negative group IDs.
To avoid that problem, don’t set s.options.maxLogins > 32, or booting a server externally, don’t specify -l > 32.
This thread was just quoted in a github bug report – in that case, the server was started externally but without any -l commandline argument. scsynth’s default number of logins is 64.
So this means it’s currently unsafe to boot a server without -l.