1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
BowelyzerOSCHub{
var <>config, <hub, <forward, <synthServer, <synthServerListener;
*new{
arg config;
^super.new.init(config);
}
// setup a NetAddr object and return it
*getNetAddr{
arg server, port;
^NetAddr.new(server, port);
}
init{
arg config;
this.config = config;
forward = BowelyzerOSCHub.getNetAddr(config.at("forwardAddress"), config.at("forwardPort"));
hub = BowelyzerOSCHub.getNetAddr(config.at("hubAddress"), config.at("hubPort"));
synthServer = BowelyzerOSCHub.getNetAddr(config.at("synthServerAddress"), config.at("synthServerPort"));
this.addAnalysisListener;
}
// setup a new listener for SynthServerAddress:SynthServerPort
addAnalysisListener{
// listen for individual SendReply messages
config.at("names").do({|name|
postln("Listening for messages called '/"++name++"' coming from scsynth.");
//TODO: use OSCdef here to be able to use key and free
synthServerListener = OSCFunc.newMatching(
{|msg, time, addr, recvPort|
postln(time.asString++": "++msg[0]++" (amplitude: "++msg[3]++"; pitch: "++msg[4]++"; has pitch: "++msg[5]++"; note on: "++msg[6]++")");
if(msg[6] != 0.0,{
postln(msg[0]++" (amplitude: "++msg[3]++"; pitch: "++msg[4]++"; has pitch: "++msg[5]);
});
},
'/'++name.asSymbol,
synthServer,
hub.port
);
});
}
//TODO: add functions to set arguments for analyzer synths generically
}
|