SenseWorld Data Network

The Sense World Data Network framework is meant to make sharing of data (from sensors or internal processes) between collaborators in an interactive media art work easier, faster and more flexible. There is a central host, which receives all data, and manages the client connections. Each client can subscribe to data nodes, to use that data in its own internal processes; and each client can publish data onto the network, by creating a node. A new client can query the network which nodes are present and is informed when new nodes appear after the client has been registered.

The SenseWorld DataNetwork was created as part of the SenseStage project, more info available on that project on the website: http://sensestage.hexagram.ca

Data Network Elements

The data network is built up from different elements:

SWDataNetwork
the network itself
SWDataNode
a node is a collection of slots, usually based upon a device or another common source (e.g. result from a function).
SWDataSlot
a slot is a single data stream

Data on the network is set by calling the function method setData with as arguments the node ID and an array of data values. The ID is an unique identifier. The function can be called for example by a class instance that parses serial data.

Each DataNode and each DataSlot can be given a label, so that their functionality becomes more human understandable.

Some nomenclature:

A DataNode, or a node, is a collection of data streams which somehow belong together.
For example, this can be representing:

An expected Node is a DataNode that is prepared to be added to the network, but may not be present yet.

A DataSlot, or a slot, is one datastream. So corresponding to the examples of nodes above a slot would represent:

A client: the programming environment of one collaborator hooked up to the network. E.g. Joe, using PureData, or Marije, using SuperCollider, or Vincent, using Processing, or Brett, using Max/MSP.

Subscription: a client can subscribe to a node to receive its data, or subscribe to a single slot of a node. These are called the client's subscriptions.

Setter: a client can provide data to the network by creating a DataNode. The client then becomes the "setter" of the node. Other clients can not set data to the same node.

SuperCollider implementation

Within SuperCollider the implementation is done in a number of classes.

SWDataNetwork is the basic implementation of the DataNetwork. You can use it in a local project to manage your datastreams within SC (not communicating with other programs), or become the host of the DataNetwork by calling the method, addOSCInterface. It is also the base class of SWDataNetworkClient, so the common usage interface between the host and the client is the same. The client has some extra methods for registering, subscribing and querying.

You can easily create a graphical user interface for the DataNetwork with the methods makeGui and makeBasicGui.

SWDataNode - SWDataStringNode are the implementations of the DataNode. You usually access them by number or by name from the DataNetwork instance.

SWDataSlot - SWDataStringSlot are the implementations of the DataSlots. You usually access them by number or by name from the DataNetwork instance.

SWDataNetworkLog can be used to read a logfile of the DataNetwork and play the data back into a DataNetwork.

SWDataNetworkSpec, SWDataNetworkOSC, and SWDataNetworkOSCClient are used internally to handle labeling of DataNodes and DataSlots, and the OSC communication of the host.

There are methods for easily adding GeneralHID devices and WiiMotes to the network. There are also extensions to use data from the DataNetwork in Patterns.

SWBusNode, SWWatcherNode, SWBusWatcherNode, SWCombineNode and SWDataAction are classes to use to process data from the datanetwork and create derived or conditioned data.

OSC interface

There is an OSC interface to the network, which allows clients to become part of the data network and access its data, and also create its own data nodes on the network.

The network will announce itself to the broadcast address of the network, to a number of ports (default: range 6000-6009, and 57120-57129), so that clients can automatically configure to connect to the network, as soon as it is in the air.

A textfile with the network's OSC port can be found in the file http://hostip/SenseWorldDataNetwork1, which can be retrieved by clients, so they know where to send the registration message.
(see Apache setup for setup instructions to make this work properly)

The general setup is that an OSC client first sends a register message to the data network server. Then it will start receiving ping messages, to which it has to reply with pong messages. The client has to query which nodes and slots are present on the network after registering, so it will receive info messages on each node and slot. Then it can subscribe to nodes and slots, and will receive data from the nodes and slots it is subscribed to via the data messages.

The client can supply a new node to the network, by using the /set/data message; it can also label the nodes and slots thus created. Whenever a new node or slot is added (or changed, e.g. when it gets a label), the client will receive a new info message. If there occurs an error in the communication, then an error message is sent. The unregister message only needs to be sent, if for example the client crashed and is trying to reconnect on the same port.

All messages to the server now have a reply, which is either the requested info, a confirmation message, or a warning or error.

Clients

Clients for other software environments are available in the Help/Clients directory.
Currently there are Max patches for Max4.6 and Max5 (created by Harry Smoak, Joseph Malloch and Brett Bergmann), PureData (Pd) patches (created by Joseph Thibodeau), a Processing and Java library (Vincent de Belleval), and a C++ library (created by Marije Baalman).

Futher documentation

Further documentation is available in the Help/doc folder, in pdf and latex source file format.
That document contains the full OSC namspace specification, how to set up the http access to the host, and the ChangeLog of the development.





1
e.g. for a host with IP 192.168.1.7 the url is: http://192.168.1.7/SenseWorldDataNetwork


Marije Baalman 2009-03-16