Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.
/ OSCforPCL Public archive

A relatively lightweight OSC library for PCL

Notifications You must be signed in to change notification settings

iKadmium/OSCforPCL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archived

This repo has been archived and will not be updated. See the new project, kadmium-osc for a more modern implementation.

OSCforPCL

A relatively lightweight OSC library for .NET Core

Usage is pretty simple -

OSCMessage messageOne = new OSCMessage("/address1", 5.0f); //one float argument
OSCMessage messageTwo = new OSCMessage("/address2", 5.0f, 3.2f, "attributes"); //two floats and a string

Bundles are supported.

OSCBundle bundle = new OSCBundle(messageOne, messageTwo);

In order to then send that to a network device:

int port = 9000;
string address = "127.0.0.1";
OSCClient client = new OSCClient(address, port);
client.Send(bundle);

To listen for OSC messages:

int port = 9000;
OSCServer server = new OSCServer(port);
//listen to messages sent to a specific address
string oscAddress = "/test";
server.AddressOnMessageReceived.Add(oscAddress, (sender, messageArgs) =>
{
  foreach(IOSCValue argument in messageArgs.Arguments)
  {
    //do something with the argument
    object value = argument.GetValue();
  }
});
//listen to messages sent to any address for which a handler is not already specified
server.DefaultOnMessageReceived += (sender, messageArgs) =>
{
  foreach(IOSCValue argument in messageArgs.Arguments)
  {
    //do something with the argument
    object value = argument.GetValue();
  }
};

About

A relatively lightweight OSC library for PCL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages