Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Das The "Open Sound Control" Protokoll würde speziell für die Kontrolle von Multimedia Installationen in einem lokalen Netzwerk entwickelt.protocol is specifically designed to control multimedia installations in a local area network or over the internet. OSC was original designed to for the data to transported local and over the internet via UDP, but it some software is setup to use OSC over alternative communication protocols. 

Due to its popularity, OSC is often the easiest way to get two or more applications, computers or devices to talk to each other.   

Tools

  • OSCulator - Routing Applikation für Application for OSX.
  • TouchOSC - OSC Interfaces für for iPad und iPhone.
  • Resolume - Kontrollierbare VJ Software .with built in OSC interface 

Processing

...

Examples 

If values are to be passed from Processing to other applications (e.g. Max MSP) or if values from these programs are to be received in Processing, we can use the Processing Library oscP5 (http://www.sojamo.de/libraries/oscP5/ ). Diese muss ebenfalls heruntergeladen werden und dann im library Ordner von Processing platziert werden.Um Werte nun per OSC an einen anderen Computer zu versenden müssen wir zunächst die Library initialisierenThis must also be downloaded and then placed in the library folder of Processing.

In order to send values to another computer via OSC, we must first import the library:

Code Block
import oscP5.*; // oscP5 Library importierenimport
import netP5.*; // netP5 Library importierenimport
 
OscP5 oscP5; // Define Kontrollobjektosc anlegenobject
NetAddress remoteLocation; // Zieladresse anlegen

...

 Define goal address

In the next step we initialise the library and set the target address:

Code Block
void setup() {
  oscP5 = new OscP5(this, 12000); // Start Librarythe startenlibrary undand aufwait Portfor 12000incoming aufmessages eingehendeon Nachrichtenport warten12000
  remoteLocation = new NetAddress("172.31.224.73", 12000); // DieThe IP Adresseaddress sowieand derport Portof desthe Empfängerrecipient
}

Nun müssen wir nur noch Nachrichten erstellen und diese and die Zieladresse schickenNow all we have to do is create messages and send them to the destination address:

Code Block
void mousePressed() {
  OscMessage msg = new OscMessage("/test"); // Neuenew Nachrichtmessage mit "/test" as alsAdresse Adress-Musterpattern
  msg.add(123); // send Einfachea Zahlsimple anhängenvalue
  oscP5.send(msg, remoteLocation);  // SendenSend the dermessage Nachricht
}

Um Nachrichten zu empfangen können wir folgenden Code hinzufügen:


}

To receive messages we can add the following code:

Code Block
void oscEvent(OscMessage msg) {
  println("### new message");
  println("AddrPattern: " + msg.addrPattern()); // Output of the address pattern
  println("TypeTag: " + msg.typetag()); // Output of the  Type-Tag
 
  // Adresse pattern test
  if(msg.addrPattern().equals("/test")) {
	// Output the number sent
    println(msg.get(0).intValue());
  }
}


P5js Examples 

Currently it's not possible to use UDP communication from javascript running in the browser. However, we can use websocket. 

Code Block
void oscEvent(OscMessage msg) {
  println("### Neue Nachricht");
  println("AddrPattern: " + msg.addrPattern()); // Ausgeben des Adress-Muster
  println("TypeTag: " + msg.typetag()); // Ausgeben des Type-Tag
 
  // Adress-Muster überprüfen
  if(msg.addrPattern().equals("/test")) {
	// Mitgesendete Zahl ausgeben
    println(msg.get(0).intValue());
  }
}

 

...