← Back to Website

OSC BRIDGE

Connecting VR Worlds and Physical Space via OSC & ESP32

THE ARCHITECTURE

This system bridges the virtual and physical environments by routing Open Sound Control (OSC) messages from virtual reality (such as Patchworld/PatchXR) to real-world physical actuators powered by ESP32 microcontrollers.

VR HEADSET
(PatchXR Sender)
♦ ───►
OSC MONITOR
(Python Forwarder)
♦ ───►
ESP32 DEVICE
(oscdevice.local)

I. THE HARDWARE CONFIGURATION

The ESP32-C3 firmware offers dual-mode capability: an easy-to-use web configuration panel and a high-performance OSC runtime engine.

Connection Fallback: The ESP32 attempts to connect to your local Wi-Fi. If it fails, it spawns its own access point named OSCdevice.
Web Dashboard: Open a browser and navigate to http://oscdevice.local (or the IP displayed in the serial monitor).
Pin Mappings: Create rules mapping OSC address patterns (e.g., /led) to physical pins using types like toggle, pulse, or pwm.
Boot Selection: Press the physical BOOT button (GPIO 9) on the ESP32 to switch between Web Config mode and OSC runtime mode.
♦ EXPLORE ESP32 FIRMWARE ♦

II. THE MONITOR & FORWARDER

The desktop helper monitors incoming OSC traffic and forwards packets between different clients, enabling multi-device orchestration.

Start the app: Navigate to the OSCWebApp directory and run run_gui.bat. This initializes a Python environment and launches the graphical interface.
Configure Listening: Input your target listening port (default is 3330) and click Start Listener.
Device Forwarding: As OSC packets hit the monitor, devices are auto-discovered. Check the boxes next to oscdevice.local (or its IP) to forward messages.
Real-time Log: Use the console to view addresses, arguments, and source IPs of incoming triggers in real time.
♦ EXPLORE OSC MONITOR ♦

III. BRIDGING THE VR GAP

To integrate physical LEDs or haptics with your virtual instruments in Patchworld:

PATCHWORLD SETUP

  1. Create an execute block or sound-trigger node.
  2. Add a port_out 3330 action node.
  3. Direct the payload to your computer's local IP address.
  4. Bind the action to an interactive object like a virtual drum or button.

OSC ADDRESS MAPS

  • Toggle: Sends a trigger to flip the state of the pin. Perfect for turning room lamps on/off.
  • Pulse: Triggers a quick pulse (e.g., 50ms) to actuate relays or solenoids.
  • PWM Fader: Maps float values from 0.0–1.0 to change LED brightness or motor speeds.
♦ ♦ ♦
“The transition from virtual gestures to physical illumination completes the loop of spatial presence.”
— OSC Bridge Integration Guide