Skip to content
프로젝트

keijiro/OscJack has 514 GitHub stars and 69 forks. Star changes are not measured yet. Last checked 2026-11-14 03:31 UTC. Last push 2022-04-25.

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
기록 수집 중
in 7 days
기록 수집 중
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

소개

Lightweight C# implementation of OSC server/client

개발 도구

README.md

Original

OSC Jack

gif

OSC Jack is a lightweight C# implementation of OSC (Open Sound Control) server/client, mainly aiming to provide OSC support to Unity.

System Requirements

  • Unity 2021.3 or later

OSC Jack requires System.Net.Sockets supported on most platforms but a few network-restrictive platforms like WebGL.

How To Install

This package is available in the Keijiro scoped registry.

  • Name: Keijiro
  • URL: https://registry.npmjs.com
  • Scope: jp.keijiro

Please follow this gist to add the registry to your project.

OSC Connection File

OSC Connection

The OSC Jack components require OSC Connection files to specify connection types, host addresses and port numbers. To create a new OSC Connection file, navigate to Assets > Create > ScriptableObjects > OSC Jack > Connection.

You must specify a target host address to send OSC messages (leave it empty for receive-only connections).

OSC Components

OSC Event Receiver

Event Receiver

OSC Event Receiver receives OSC messages and invokes a UnityEvent with received data.

OSC Property Sender

Property Sender

OSC Property Sender observes a component property and sends OSC messages on changes to it.

OSC Monitor

OSC Monitor

OSC Monitor is a small utility inspecting incoming OSC messages. To open the monitor, navigate to Window > OSC Monitor.

Low-Level API

Supported data types

At the moment, the OSC Jack low-level API only supports int, float and string data types.

OscClient (implements IDisposable)

OscClient is a class for sending OSC messages, supporting up to four arguments within a single message.

// IP address, port number
using (var client = new OscClient("127.0.0.1", 9000))
{
  // Send two-component float values ten times.
  for (var i = 0; i < 10; i++)
  {
    yield return new WaitForSeconds(0.5f);
    client.Send("/test",       // OSC address
                i * 10.0f,     // First element
                Random.value); // Second element
  }
}

OscServer (implements IDisposable)

OscServer is a class for receiving OSC messages, supporting up to four arguments within a single message.

You can add a delegate to MessageDispatcher to receive messages sent to a specific OSC address (or give an empty string to receive all messages).

Please note that the server invokes the delegates in the server thread. You may have to queue the events for processing them in the main thread.

using (var server = new OscServer(9000)) // Port number
{
  server.MessageDispatcher.AddCallback(
    "/test", // OSC address
    (string address, OscDataHandle data) => {
        Debug.Log(string.Format("({0}, {1})",
            data.GetElementAsFloat(0),
            data.GetElementAsFloat(1)));
    }
  );
  yield return new WaitForSeconds(10);
}

관련 프로젝트 살펴보기