Max5 Client: Simple

The Max5 clients for the SSDN take the form of two abstractions: dn.node and dn.makenode

To subscribe to a node:

  • Create an object in your patch with the text pv dn-host <IP>, replacing <IP> with the IP address of the SSDN host (something like pv dn-host 192.168.0.104)
  • Create an instance of the dn.node object with two arguments: the first argument specifies your client name, and the second specifies the node number to be subscribed to (something like dn.node my_client 224). Alternatively you can provide a list of node numbers instead of the single node number argument; the client will subscribe to all of them.

The dn.node object has two outlets: the left outlet will output the received data corresponding to the first node argument, and the right outlet will output the data for all subscribed nodes preceded by the node number. Messages to dn.node can dynamically change the subscriptions: the message “add 333″ will add a subscription to the node 333, and the message “remove 224″ will unsubscribe from node 224. Note that if dynamic subscriptions are used only the right outlet will be active to avoid ambiguity. A “bang” sent to dn.node will reinitialize the connection with the SSDN host.

To publish a node:

  • Create an object in your patch with the text pv dn-host <IP>, replacing <IP> with the IP address of the SSDN host (something like pv dn-host 192.168.0.104)
  • Create an instance of the dn.makenode object with 3 arguments: the first argument specifies your client name, the second specifies the node number you wish to create, and the third argument specifies the number of slots in the new node.

The dn.makenode object has two inlets: the left inlet accepts data to be published; the right inlet allows dynamic changing of the node published by the object. A list of two integers passed to the right inlet will be interpreted as <node number> <number of slots>, the old published node will be destroyed, and a new node will be published using the new information. A “bang” passed to the right inlet will reinitialize the connection with the SSDN host.

Comments/Questions

Comments are closed.