Polar to OSC is a lightweight Rust tool that bridges Polar heart rate sensors to OSC (Open Sound Control).
It connects to a Polar device over Bluetooth Low Energy (BLE), listens for real-time heart rate updates, and broadcasts them via OSC, making it easy to integrate biometric data into creative tools, games, and interactive environments such as VRChat, TouchDesigner, Max/MSP, or Unity.
- 🔗 Connects to Polar BLE heart rate devices
- ❤️ Streams live heart rate (BPM) data
- 📡 Sends data over OSC via UDP
- ⚡ Low-latency, real-time updates
- 🦀 Written in Rust (fast, minimal, reliable)
The application sends OSC messages with the following format:
Address
/heartrate
Arguments
int32 — BPM (beats per minute)
Example
/heartrate 72
- A compatible Polar heart rate sensor
- Bluetooth Low Energy (BLE) support
- Rust toolchain (
cargo,rustc) - Linux, macOS, or Windows with BLE support
polar_to_osc DEVICE_ID HOST_IP:HOST_PORT CLIENT_IP:CLIENT_PORT
| Argument | Description |
|---|---|
| DEVICE_ID | Polar device ID (e.g. B97DCF60) |
| HOST_IP:HOST_PORT | Local address to bind the UDP socket |
| CLIENT_IP:CLIENT_PORT | Destination OSC client address |
Send heart rate data to VRChat (default OSC port 9000):
polar_to_osc B97DCF60 127.0.0.1:2222 127.0.0.1:9000
This will continuously stream BPM updates to:
/heartrate
flowchart LR
A[Polar Heart Rate Sensor] -->|BLE| B[polar_to_osc]
B -->|HeartRate BPM| C[OSC Encoder]
C -->|UDP / OSC| D[OSC Client]
D -->|/heartrate| E[VRChat / TouchDesigner / Unity]
- Connects to the Polar device using Bluetooth LE
- Subscribes to heart rate notifications
- Receives BPM updates in real time
- Encodes the data as an OSC message
- Sends the message via UDP to the configured client
- arctic – Polar BLE communication
- rosc – OSC encoding
- tokio – Async runtime
- Ensure no other application is connected to the Polar device
- Bluetooth adapters must support BLE
- The OSC client must be listening on the target port
MIT License — free to use, modify, and integrate into your own projects.