aboutsummaryrefslogtreecommitdiffstats
path: root/BowelyzerOSCHub.sc
diff options
context:
space:
mode:
Diffstat (limited to 'BowelyzerOSCHub.sc')
-rw-r--r--BowelyzerOSCHub.sc41
1 files changed, 30 insertions, 11 deletions
diff --git a/BowelyzerOSCHub.sc b/BowelyzerOSCHub.sc
index 4a7db26..7de5b72 100644
--- a/BowelyzerOSCHub.sc
+++ b/BowelyzerOSCHub.sc
@@ -15,7 +15,7 @@ BowelyzerOSCHub{
init{
arg config;
this.setupNetAddressesFromConfig(config);
- this.setupSynthListener(config);
+ this.setupSynthListenersFromConfig(config);
}
setupNetAddressesFromConfig{
@@ -25,23 +25,42 @@ BowelyzerOSCHub{
synthServer = BowelyzerOSCHub.getNetAddr(config.at(\synthServerAddress), config.at(\synthServerPort));
}
-// setup OSCdef for SynthServerAddress:SynthServerPort
- setupSynthListener{
+ // setup OSCdef for SynthServerAddress:SynthServerPort
+ setupSynthListenersFromConfig{
arg config;
// listen for individual SendReply messages
config.at(\inputs).keysValuesDo({|name, input|
postln("Listening for messages called '/"++name++"' coming from scsynth at "++synthServer.ip++":"++synthServer.port++".");
- OSCdef.newMatching(
- name,
- {|msg, time, addr, recvPort| this.forwardToNetAddress(msg, time)},
- name,
- synthServer,
- hub.port
- );
- OSCdef(name).enable;
+ this.addSynthListener(name);
});
}
+ addSynthListener{
+ arg name;
+ OSCdef.newMatching(
+ name,
+ {|msg, time, addr, recvPort| this.forwardToNetAddress(msg, time)},
+ name,
+ synthServer,
+ hub.port
+ );
+ }
+
+ startSynthListener{
+ arg name;
+ OSCdef(name).enable;
+ }
+
+ stopSynthListener{
+ arg name;
+ OSCdef(name.asSymbol).disable;
+ }
+
+ freeSynthListener{
+ arg name;
+ OSCdef(name.asSymbol).free;
+ }
+
//forward a received OSC message to the globally specified forward address
forwardToNetAddress{
arg msg, time;