why do I want to use another server than the default ("local server")?
- for wave display in a scope window, for example, you need to use the internal server
- for working on another computer or preparing a piece that will work on several computers, you want to send to another server's address
how to do it:
- many patches use the interpreter variable 's' for sending messages to it. normally this is the local server: check: s === Server.local
- you can change this easily by assigning another server to it: s = Server.internal
- if you want to use { .... }.play; you can set the default server to your desired target: Server.default = s = Server.internal
- if you want that change to be permanent, you can change this in Main.sc
remote server usage:
a remote server can be accessed by creating a model object:s = Server(\name, NetAddr(hostname, port))
- This server has to be booted on the remote machine (or by ssh connection), for example by running scsynth from the command line (can use the -u or -t switches to set a non-standard UDP or TCP port). The server can then be accessed via its Server object and used like the local/internal server.
- A server run from the command line needs to have its default group initialized (by calling "initTree" on its Server object in sclang). You may also want to run "notify", in order to use queryAllNodes, get \tr messages back from the server, etc.
- Note that sclang Server objects use UDP by default, but this can be set to TCP by creating a ServerOptions object, setting "protocol" to \tcp, and passing this to the Server constructor.