GH+Python Practice #01 | OSC

Contents

  1. OSC
  2. gHowl
  3. Communication
    1. grasshopper <- iOS / Android App
    2. grasshopper <-> grasshopper
  4. Practice

OSC

OSC is a protocol for communication developed by CNMAT(The Centre for New Music and Audio Technologies) in UC Barkley. As CNMAT says, the feature of OSC is following:

Open Sound Control (OSC) is a protocol for communication among computers, sound synthesizers, and other multimedia devices that is optimized for modern networking technology. Bringing the benefits of modern networking technology to the world of electronic musical instruments, OSC’s advantages include interoperability, accuracy, flexibility, and enhanced organization and documentation.

The protocol of OSC can be roughly divided into 2 parts. One is “Message” and second is “Arguments”. You can give title which indicates its property to sending data as “Message” and value to send as “Arguments”. The protocol of OSC is following:

/<OSC Message> <OSC Arguments 1><OSC Arguments 2>...

And mainly OSC is used with UDP/IP as transmission method. As this transmission methods are basically used for internet communication, you need to define IP address of receiver . You need to define a port number of your software and also input the port number of the software to send for UDP. The diagram bellow is the example of schematic of OSC communication network.

diagram_osc

gHowl

gHowl is a grasshopper add-on that enable communication among softwares/devices with internet based communication methods such as OSC.

gHowl has 3 components to for OSC :

  • NetSource  –  get network properties of your computer
    • output
      • N  –  boolean value if network adapter is working or not
      • S  –  text value of network adapter properties
      • @  –  text value of current IP address of your computer in the local network
  • UDP Sender  –  send data with UDP
    • input
      • @  –  IP address of receiver
      • P  –  port number of receiver
      • #  –  protocol to use, 999 for OSC
      • D  –  data to send
    • output
      • I  –  network information
  • UDP Receiver  –  get data with UDP
    • input
      • @  –  your IP address
      • P  –  your port number
      • #  –  protocol to use, 999 for OSC
    • output
      • I  –  network information
      • D  –  gotten data

Communication

grasshopper <- iOS / Android App

For the iOS / Android App, I used Control(OSC + MIDI). This app is available for iOS and Android.

Before making your phone to connect to Processing, your computer and phone need to be connected to the same wifi network. If you cannot prepare for it, you can use Tethering for Android or network sharing for iOS.

And also you need to configure software setting to tell your phone the location of your computer. Run the app and configure setting as following:

App menu -> Destinations -> "+"

And then fill your computers IP address to first text box and processing’s port number to second text box.

grasshopper <->grasshopper

Use NetSource component to check the network properties of the computer you are going to communicate.

Practice

  • Send/receive position and location of the box in grasshopper
  • Send/receive point cloud in grasshopper
  • Send/receive DataTree