4. Communicate


Content

1. Using Open Sound Control (OSC) in Android Mode
2. Get the IP-Adress of current device
3. Collective drawing
4. Send data from computer to mobile device
5. Messenger app: Exchange data between mobile phones
6. Connecting to Arduino through OSC




1. Using Open Sound Control (OSC) in Android Mode

2. Get the IP-Adress of current device

To have other devices send you data via OSC you have to tell them your name. In a network this name is your IP-adress. Usually this adress is given dynamically, so you get a different name everytime you log to the network. In OSC it`s a good practice to look up your IP and tell other members of the network


import java.net.InetAddress;
import java.util.*;

InetAddress inet;
String myIP;

void setup(){
  try {
     inet = InetAddress.getLocalHost();
     myIP = inet.getHostAddress();
     println(myIP);
text("Your IP-Adress is: "+myIP, 20, 20);
  }
  catch (Exception e) {
     e.printStackTrace();
     myIP = "couldnt get IP"; 
  }
}

void draw(){
  
}
	



3. Collective drawing

The goal is to send the drawings we do on our local Computer to a Host that displays the collective drawings. Of course the coordinates of the points could later easily used for more complex interactions between the actors.

First we`ll write an app that sends the coordinates of drawings we do with the mouse via network.


  	

Now we need a host app that collects all the incoming data and displays it as drawings.


  	

Example: Ubiq Drawing Table by Iannis Xenakis

3. Send data from computer to mobile device

First we build an app that sends data from our computer to the network via OSC. This data can be anything from datasets loaded from the internet (e.g. JSON-data), data from controllers and interfaces or results of chance operations (later we wil see how to send interface data generated from hand-tracking by Leap Motion).

But for now we`ll keep it simple and stick to mouse coordinates.


  	

In the App for the Devices we define how the incoming data should be translated to audiovisual output. Again the mapping of the data to certain audiovisual paramters can be chosen freely and is subject to artistic expression.


  	



4. Messenger app: Exchange data between mobile phones

With the basic insights we gained so far we are able to biuld a simple messenger app in processing.


  	

5. Connecting to Arduino through OSC