npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jp.keijiro.osc-jack

v2.0.0

Published

Lightweight implementation of OSC server/client

Downloads

6,693

Readme

OSC Jack

gif

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

System Requirements

  • Unity 2021.3 or later

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

How To Install

This package uses the scoped registry feature to resolve package dependencies. Open the Package Manager page in the Project Settings window and add the following entry to the Scoped Registries list:

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

Scoped Registry

Now you can install the package from My Registries page in the Package Manager window.

My Registries

OSC Connection

OSC Connection

You have to create an OSC Connection file to specify a connection type, a host address and a port number. To create a new OSC Connection file, navigate to Assets > Create > ScriptableObjects > OSC Jack > Connection.

At the moment, OSC Jack only supports the UDP connection type.

You have to specify a target host address to send OSC messages (you can 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

OscClient (implements IDisposable)

OscClient is a class for sending OSC messages. It supports int, float and string types. It also supports sending up to four elements 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. 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 have to queue the events for processing them in the main thread.

It supports int, float and string types. It also supports receiving up to four elements within a single message.

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);
}