Restarting NodeID Count

Is there a way to clear all of the NodeIDs deployed and start over again from 1000?


You can use Server:freeAll - e.g. Server.default.freeAll - to clear all running nodes. You can restart the node allocator with e.g. Server.default.nodeAllocator.reset, but this will create bugs if you have any synths or groups running on the server when you do it (including e.g. the Server volume control), since you can end up overwriting them or otherwise confusing things.

It’s worth noting that any code that is relying on specific node id numbers is going to be suuuuuper fragile. There’s no guarantee at all that node numbers start at 1000, nor that they follow any particular ordering after that - this is an internal detail of the Server, and can change based on some configuration stuff like client id. If you have code expecting anything like that, it might be worth brainstorming a different way of getting the desired behavior?

this is an internal detail of the server, and can change based on some configuration stuff like client id.

Small nitpick: node IDs are solely managed by the client(s), so it’s rather a client implementation detail.

1 Like

Just for fun – if you are creating 100 nodes per second at a steady rate (which is well faster than typical musical usage), how long could you go before “running out” of node IDs?

2 ** 26  // node IDs available for one user
* 0.01  // seconds per node (100 per sec)
/ 60  // * 1/60 min/sec
/ 60  // * 1/60 hr/min
/ 24  // * 1/24 days/hr

~= 7.76 days

… where 5-6 hours would be a long SC session. (Even at 1000 nodes per second, you’d get 0.776 days or a bit over 18 hours.)

So there’s not even really a practical reason to reset the node allocator… you’d run out if you kept SC running forever, even when sleeping the session, and never ever recompiled the class library or rebooted the server. Short of that, there are plenty of IDs, don’t worry about it.