The objects [netsend] and [netreceive] are included in the standard Pure Data (vanilla) distribution for communications over IP networks, using either the TCP or UDP protocols.
The only objects specifically needed to make use of OSC are [oscformat] and [oscparse], and those are also included in all Pd distributions.
Since OSC messages are a binary format and normally sent using the UDP protocol, it is necessary to include the flags -u -b to both [netsend] and [netreceive] (as they default to TCP and ascii formats).
IP network communications are associated with specific IP addresses and port numbers. [netreceive] will always be associated with the IP address of the host device but a “listen port#” message must be sent to it to specify the port number. “listen 0” will close the port.
[netsend] must be sent a “connect IPaddr port#” message to specify the IP address and port number of the device to communicate with.
The [route] object can be used to filter for specific address patterns. NOTE: Arguments to [route] can be numbers or symbols but not a mixture of the two. For OSC address parts that correspond to numbers, we must convert the ascii representations to float values before they are passed into the [route] object (because the arguments used in the [route] object are numerical, not symbolic).
Applications that support the creation of customizable user interfaces (UIs) and output OSC include TouchOSC
and Syntien.
NOTE: McGill's network filters out UDP packets between devices. The example above will work at McGill if both the Pd patch and the OSC application (such as TouchOSC) are running on the same device but not if they are on different devices. Another option is to have an OSC app running on your phone, create a hotspot on your phone, and connect your computer to the phone's hotspot.
You can find your computer's IP address by typing ipconfig getifaddr en0 in a terminal window.