diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Bowelyzer.sc | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/classes/Bowelyzer.sc b/classes/Bowelyzer.sc index 7f75720..28166ca 100644 --- a/classes/Bowelyzer.sc +++ b/classes/Bowelyzer.sc @@ -11,11 +11,7 @@ Bowelyzer{ //initialize with configuration, if available (else use default) arg configFile; config = BowelyzerConfig.new(configFile); - server = Server.new( - \bowelyzer, - NetAddr.new(config.config.at(\synthServerAddress), config.config.at(\synthServerPort)) - ); - Server.default = server; + this.addServer; server.waitForBoot({ this.setupNetAddressesFromConfig(config.config); this.setupSynthListenersFromConfig(config.config); @@ -28,6 +24,26 @@ Bowelyzer{ {"scsynth failed to start!".postln}); } + // add a scsynth server and make it the default + addServer{ + var addr = NetAddr.new(config.config.at(\synthServerAddress), config.config.at(\synthServerPort)); + // if the NetAddr is local, boot locally, otherwise remote + if(addr.isLocal,{ + server = Server.new( + name: \bowelyzer, + addr: addr, + options: Server.default.options + ); + },{ + server = Server.remote( + name: \bowelyzer, + addr: addr, + options: Server.default.options + ); + }); + Server.default = server; + } + // add OSCdefs listening for GUI events addGUIListeners{ // listen for control changes |