Skip to content

add OSC send and receive - #293

Open
v10101a wants to merge 2 commits into
processing:mainfrom
v10101a:osc
Open

v10101a wants to merge 2 commits into
processing:mainfrom
v10101a:osc

Conversation

@v10101a

@v10101a v10101a commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

first attempt for #179, adds OSC over UDP for Rust and Python

API

  • osc_listen(port): starts listening for OSC messages on port and returns the port. fails with an error if the port is already in use.
  • osc_send(host, port, address, args...): sends one message, e.g. osc_send("127.0.0.1", 12000, "/mouse", 0.5, 0.25).
  • osc_read(): returns every message received since the last call, oldest first. it can be called every frame like midi_read().
  • osc_stop(): stops listening and closes the port. osc_read() gives an error until osc_listen() is called again.
  • Python: messages are OscMessage objects with address, args, typetag (e.g. "ff" for two floats), host and port. str(msg) gives a readable form like /mouse 0.52 0.25.

Changes

  • added crates/processing_osc/
  • added osc error messages to crates/processing_core/src/error.rs
  • src/lib.rs, src/prelude.rs: add OscPlugin and export the osc_* functions
  • added crates/processing_pyo3/src/osc.rs: converts Python values to OSC types, defines the OscMessage class && crates/processing_pyo3/src/lib.rs: registers the Python functions and OscMessage
  • added OSC IN/OUT examples examples/osc.rs and crates/processing_pyo3/examples/osc.py
  • used rosc instead of nannou_osc, since nannou_osc doesn't have a Bevy plugin. we could probably switch later without changing the API!

some limitations

  • IPv4 only (no IPv6, TCP or multicast yet)
  • only one listening port at a time.
  • foats are sent as 32-bit.

tested on macOS with TouchDesigner

LLM use: wrote the crate and bindings, reviewed the API, and wrote first version of example code with Claude Code

@github-actions

Copy link
Copy Markdown

Visual regression: 1 changed of 43 cases

case status detail
py_flocking_gpu ❌ changed 7.71% of pixels differ

If these changes are intentional, add the deliberate-rendering-change label.

baseline e74f60006a · adapter llvmpipe (LLVM 20.1.2, 256 bits) (Vulkan, Mesa 25.2.8-0ubuntu0.24.04.5 (LLVM 20.1.2))

Open the visual report · workflow run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant