| [explains how the commincation between IpSon and computer works] | |
| IpSonLab OSC strings explained | [explenation of the OSC messages (strings)] |
| UDP Versus Open Sound Control (OSC) | [ difference between UDP and OSC] |
IpSonLab communication setup (OSC communication) (back to the top)
| The IpSonLab and IpSonCompact both use Open Sound Control for communication. In this chapter we explain how this works. For more detailed information about Open Sound Control (OSC), check out the website of Berkely. http://www.cnmat.berkeley.edu/OpenSoundControl |
| Both the IpSonlab and the IpSoncompact do send high speed data to the net; when travelling over the net, the UDP protocol is used. Both inside the computer and the IpSonLab, the OpenSoundControl (OSC) protocol is used to exchange data. The 8 bit sensor values (32 times) are all packed together into one OpenSoundControl message, which, in case of the IpSonLab, always starts always with /ipson (slash ipson) The string looks like this: |
||
![]() |
||
| The OpenSoundControl protocol uses 32 bit comminucation. This means that the data packages send to and from port to port, are always 32 bit wide and can be divided into 4 packages of 8 bit (= 4 x 1 byte ). The IpSonLabt sends 8 bit sensor values. For sending and receiving at a high rate, four sensor values are being packed into one 32 bit OSC integer; as can be seen in the figure above. To make the setup of the string more clear, check the following figure: | ||
|
||
| For extracting the data and getting the right readings within the computer (Max/Msp, Super Collider), it is nessecary to unstuff the incoming string. First by using the [osc-route /ipson] object, to rertrieve the right string. After unpacking the string into 8 times 32 bit osc integers (representation of 8 x i), the actual osc integer can be ripped into 4 times 8 bit values. Max example: |
||
![]() |
||
| The four 8 bit sensor values, packed into one OSC integer, have to be unpacked: When shifting the total string 8 bits to the right, anding (logic) with 255 , gives the right value for in2 (see string setup above). When you want to unpack in0, you have to shift the total string 24 bits to the right, anding it with 255 et voila the value of input 0 will come out. Check the Max 'unstuff' example: |
||
![]() |
||
| The unstuffing is actually bit-shifting (place the bits in the right position). Incoming data (osc integer) is been triggered four times (t i i i i). The outputs are bit shifted. The outlets generate four independent 8 bit numbers. | ||
IpSonLab OSC strings explained (back to the top)
![]() |
|
| The IpSonLab sends and receives OSC data from/to your computer. The IpSonLab can also be configured (adjusted) to set the amount of inputs and the threshold per input. To drive the diffrent output processes, the IpSonLab can be provided with an extra 'output processor'. Here an explenation of the different OSC string setups used within the IpSonLab. | |
Analog sensor information |
|
| /ipson ,iii iiii i000 [in0, in1, in2, in3]...[in28, in29, in 30, in31] | |
| As shown above, this is the main data stream, sending the values of the 32 analog inputs, into 8 bits packages. | |
| in0 -in31 32 times 8 bit (0-255) analog input values. |
|
| Distance measurement values | |
| /di ,ii0 [distance1, distance2] [ distance2, distance3] | |
| The IpSonLab can handle up to four ultrasonic distance measurements (srf05), which can be directly connected to the processor. The distance values are 10 bit wide; so four distance values are packed into two OSC integers. |
|
| Switch (greycode) values | |
| /sw ,i00 [count1, up/down1, count2, up/down] | |
| Two greycode switches can be directly connected to the processor of the IpSonLab. They are connected to the same port as the ultrasonic distance measurement sensors, so they cannot be used both at the same time. Four 8 bit values are sent within one 32 bit OSC integer. Per greycode switch a counter is sent and a direction (1/0 up/down). |
|
| Configuration string setup | |
| /cf ,iii iiii ii00 [ninput,x,x,x] [th0,th1,th2,th3]..[th28, th29, th30, th31] | |
| The /cf string sends the configuration to the IpSonLab. It tells the IpSonLab how many inputs are in use (this actually determines the sample rate of the IpSonLab) and which threshold value is set per input. | |
| ninput: set the amount of active inputs (in groups of 4) th0-th31: Threshold is a 8 bit value(0-255) adjusting the threshold per analog input. |
|
| Status request string | |
| /ee ,iii iiii ii00 [ninput,x,x,x] [th0,th1,th2,th3]..[th28, th29, th30, th31] | |
| When sending the configuration string to the IpSonLab (sending /cf), the IpSonLab always responds with a status string, verifying the given configuration. The structure of the string is the same as the /cf string. |
|
UDP Versus OSC (back to the top)
UDP, the "User Datagram Protocol," is the Internet Protocol for sending packets (a.k.a. "datagrams") between machines without establishing a connection between the machines and without any expensive mechanism for detecting lost packets and retrying them. UDP is used for streaming video and audio and many other applications on the Internet.OpenSound Control is an application-level protocol. OSC defines only the bit format and interpretation of those bits; you could transmit OpenSound Control messages via UDP, TCP, shared memory, compact disc, or any other digital protocol.Because UDP can be used to transmit many kinds of data besides OSC, and because OSC can be transmitted by many kinds of networking technology besides UDP, our implementation puts the UDP part and the OSC part in separate objects. People have used the OTUDP object without the OpenSoundControl object to send and receive data in formats other than OSC. (This requires writing a max external to translate between Max data and binary data in the non-OSC format.) People have used OpenSoundControl without UDP as a sort of super pack/unpack, to be able to pass entire OSC bundles as single Max messages.Nevertheless, the main use of both the OTUDP and OpenSoundControl Max objects is to use them together, as shown by the help patches |