4

I'm using SuperCollider, and I want to basically package up a music script that's been written. This is under the goal of wanting to call it from Unreal Engine 4, for what it's worth.

I know SuperCollider runs with a server/client mentality, with scsynth being the server and sclang being the client. I'm on a Mac machine, and I'm trying to start up sclang/scsynth manually. Here's what I expected.

$> scsynth -u 2000 # This is running in another Terminal tab...

$> sclang -u 2000 MyScript.scd # Shouldn't this hook it up?
# An interactive terminal starts here...Shouldn't my commands
# be going to the server I started up?

Any ideas?

SharkCop
  • 1,080
  • 2
  • 12
  • 19

1 Answers1

4

A small misunderstanding about the port numbers. Both scsynth and sclang can listen on a UDP port. In your code example you have started scsynth listening on 2000, and then you start sclang listening on 2000. That's two processes listening on 2000, not one process sending and one process listening.

If you start scsynth on port 2000, then the way to talk to it is not with sclang -u 2000, but by setting the port from within your sclang script. If I assume you're using the default server, then you can check what NetAddr the language thinks it's talking to:

   "Default server is at this IP and port: %".format(Server.default.addr).postln;

If you want to set it to port 2000:

  Server.default.addr.port = 2000;
Dan Stowell
  • 4,618
  • 2
  • 20
  • 30