Here is an implementation of OSCresponder / OSCpathResponder / OSCresponderNodethat uses symbol signatures for lookup. (I've added an extension to Main.sc tom amke the testing easier)
This implementation takes 60 % less time to do the match. This also lowers the idle cpu of sclang a little bit, because the status messages coming from servers are looked up more efficiently. More optimization along these lines could maybe be done in OSCresponder2-respond and -makeSignature.
- maybe OSCresponderNode could be replaced by a method (analog to .add: .replace?) in OSCresponder.
- maybe an implementation of OSCpathResponder based on a multilevel dictionary would be faster.
There is a forward field in class OSCresponder that allows other message parsing schemse to be added like this: // printing ( OSCresponder2.forward = { arg time, msg, addr; if(msg[0] != 'status.reply') { msg.postln } }; ) // stop printing OSCresponder2.forward = nil;- I don't know all implications of OSCpathResponder, so Ron, if you find the time, could you check if it works?
I have tested it with Bus-getn and it seems to work. btw. What is the dummy OSC command ('/c_end', #[1]); for? also why does OSCresponder.respond return "true"?
Attachment:
%OSCresponder2.tar.gz
Description: application/applefile
Attachment:
OSCresponder2.tar.gz
Description: Binary data
-- .