krisharris.org - tripping out the world, 8 bits at a time

OSCwitchboard Config Files

posted by kristopf    December 8th, 2008
OSCwitchboard Config Files

OSCwitchboard currently does not have a GUI for configuring routes, so you must edit the two config files stored in the application’s data directory.

hosts.xml

This file contains a list of the hosts that OSCwitchboard knows about. It’s format is simple, enclosed in a <hosts> tag, there are any number of host tags formatted like this:

<host name="gamepad" ip="10.0.1.3" port="1337"/>

Example hosts.xml file:

<hosts>
	<host name="gamepad" ip="10.0.1.3" port="1337"/>
	<host name="frontend" ip="10.0.1.8" port="9999"/>
	<host name="otherhost" ip="127.0.0.1" port="9998"/>
</hosts>

routes.xml

This file contains a list of the OSC Message paths to route. Enclosed in a <routes> tag, there are any number of <route> tags. The route tag has a mandatory attribute baseaddress which is the incoming message’s OSC address (ex: /gamepad/0/button/a/). Inside each route are a number of <rule> tags.

Rule Tag Classes

<rule class=”send”>

Inside the <rule class=”send”> tag, put a messagetag with an attribute namespace, representing the address for the outgoing message. If no namespace tag is specified, the incoming message’s address will be used. Inside the message tag, you can put any number of value tags, the contents of which will be sent as arguments in the OSC message. If the message tag is empty (no value tags defined) the incoming message will be forwarded.

Example Rule using the send class:

<route baseaddress="/gamepad/0/button/start/" from="gamepad">
	<rule class="send">
		<message namespace="/game/start/">
			<value typetag="s">Start Game</value>
		</message>
		<host name="frontend"/>
	</rule>
</route>

Look at the source code, or the example file for more information.


Leave a Reply