Quick start

Simple OSC implementation in pure Python.

This library was developped following the specifications at http://opensoundcontrol.org/spec-1_0 and is currently in a beta state.

Features

  • UDP client and server
  • int, float, string, blob, true, false OSC arguments support
  • blocking/threading/forking server implementations
  • simple API

Installation

Download library source code and unpack in your project. Download it here http://bitbucket.org/grailapp/osc

Usage

Examples you can found in Examples section of this documentation.

Quick reference

# create osc message with address '/message/address'
message = OSCMessage(address='/message/address')

# argument can be string, int, float, bool and binary
message.add( 'Some text argument' )
message.add( 3 )
message.add( 0.75 )
message.add( True )

# create osc bundle and add a message
bundle = OSCBundle()
bundle.add( message )

# create client and send to 127.0.0.1:8000
client = OSCClient('127.0.0.1', 8000)
client.send( message )
client.send( bundle )

# bind server and listen for incoming messages at 127.0.0.1:8000
server = OSCServer('127.0.0.1', 8000)
server.serve_forever()