Skip to content

Honzackcz/PulsoidToOSC

Repository files navigation

PulsoidToOSC

pulsoid

PulsoidToOSC is a simple, effective, and universal application that streams heart rate data from Pulsoid to OSC.
The main window is designed to be easily used in VR with applications like OVR Toolkit, allowing you to place it on your hand like a monitor.
Also includes easy-to-use VRChat integration with automated configuration through OSC query, letting you send heart rate data to your avatar or even to the chatbox with a customized message.

Requires .NET 10.0 Desktop Runtime

Installation

  1. Download latest version of PulsoidToOSC.zip from Releases.
  2. Extract PulsoidToOSC.zip to your desired location.
  3. Open extracted PulsoidToOSC folder and launch PulsoidToOSC.exe - if required, install also .NET 10.0 Desktop Runtime.

Pulsoid Account Linking

To link your Pulsoid account, you will need to authorize this app:

  1. In options click the "Link account" button - this will open the Pulsoid authorization page in your web browser.
  2. Log in and confirm authorization on the page.
  3. Now you can close the authorization page, the account will be linked shortly in the app.
  4. Green checkmark will indicate succesful link and you can now start using PulsoidToOSC.

If the account is not linked, repeat the steps above. In case it still does not work, you can enter Pulsoid token manually.

Disclaimer: Anyone with access to the token can read real-time heart rate data from Pulsoid.

Auto Start

This option starts the connection to Pulsoid and OSC when the app is opened, saving you one click.

It will NOT start the application with the system.

OSC Options

You can set up a manual OSC endpoint, which can be any application capable of receiving OSC data, such as VRChat or Resonite.

The endpoint requires a specified IP, Port, and Path where heart rate parameters will be sent.

Default values are set to work with VRChat running on the same PC.

VRChat

OSC Query Auto Configuration

When enabled, all data will be sent to VRChat clients running on localhost (the same PC where this app is running) automatically, independent of the OSC settings. If you want to use this app only for VRChat, you can disable sending data to the manual OSC endpoint.

If you want to run this app on a different PC than VRChat but on the same LAN, you can enable "Send to all VRC Clients on LAN".

Chatbox Messages

This setting provides simple options to send heart rate data to the VRChat chatbox with customized messages.

Messages containing key <bpm> will automatically replace this key with the heart rate value. If the message doesn't contain the key, the heart rate will be added at the end of the message.
For example, this message Heartrate: <bpm> BPM will appear in the VRChat chatbox as: Heartrate: 123 BPM

Another key is <trend> that will be replaced with an arrow indicating trend of how much the heart rate is changing.

Chatbox messages also support new line characters.
\v or /v will simply start new line.
\n or /n will start new line by filling the rest of the current line with spaces, thereby making the chatbox as wide as possible.

Messages are sent to the manually defined OSC endpoint and all auto-configured VRChat clients.

Display and sound on avatar

Ready to use prefab of simple display for VRChat avatar with easy installation with VRCFury.
Requires just one int (8 bits) of synced avatar parameters. The display have just one static mesh of one Quad (2 triangles) and one material slot.
The package also includes Heart Beat Audio addon prefab. Heart beat sound tempo is synced with heart rate value and sounds are randomized, so they will not sound too repetitive.
Download: Heart Rate Display unitypackage
This display use edited version of RED_SIM's Simple Counter Shader.

OSC Parameters

Parameters are combined with your defined OSC path, which you can set in the OSC options. In the case of VRChat auto-configuration, the OSC path is defined as /avatar/parameter/, ensuring access to the parameters within avatars.

An example of a full path combined with a parameter might look like this: /avatar/parameter/HeartRateInt

Default parameters are set up according to this table:

Parameter Name Value Type Description
HeartRateInt Int Heart rate - Integer [0, 255]
HeartRate3 Int Same as HeartRateInt
HR Int Same as HeartRateInt
HeartRateFloat Float Heart rate - Float ([0, 255] -> [-1, 1])
HeartRate Float Same as HeartRateFloat
FullHRPercent Float Same as HeartRateFloat
HeartRateFloat01 Float Heart rate - Float ([0, 255] -> [0, 1])
HeartRate2 Float Same as HeartRateFloat01
HRPercent Float Same as HeartRateFloat01
HeartBeatToggle Bool Toggles with each OSC update
isHRBeat Bool Toggles with each OSC update
isHRConnected Bool True when app is working
isHRActive Bool True when app is working

These parameters are chosen to support most currently used systems. In practice, the only necessary parameters are HeartRateInt for data and the additional HeartBeatToggle for reliable detection of timeouts.

In case you want to use selees824's display 【VRCFury|MA 対応】HeartRate OSC you will need to add parameters HR Float [0, 1] named hr_percent and Bool Active named hr_connected then set maximal range of heart rate float to 200.

All parameters can be easily edited.

Supported parameter types are:

Parameter Type Value Type Description
HR Integer Int Heart rate - Integer [0, 255]
HR Float [-1, 1] Float Heart rate - Float ([0, 255] -> [-1, 1])
HR Float [0, 1] Float Heart rate - Float ([0, 255] -> [0, 1])
Bool Toggle Bool Toggles with each OSC update
Bool Active Bool True when app is working
Trend [-1, 1] Float Trend of heart rate change - Float [-1, 1]
-1 = decreasing; 0 = stable; 1 = increasing
Trend [0, 1] Float Trend of heart rate change - Float [0, 1]
0 = decreasing; 0.5 = stable; 1 = increasing

Heart rate adjustments

In Heart rate options is possible to setup adjustments to how heart rate value is reported to the parameters.

  • Heart rate float range adjusts range of heart rate values for systems that tries to improve accuracy by reducing minimal and maximal value of heart rate. By default the float uses full range of 0 - 255 because 8 bit float [-1, 1] should be able to handle all the possible values.
  • Heart rate trend range adjusts Trend sensitivity to how fast heart rate is changing. Higher values will make the trend indication less sensitive.
  • Heart rate offset will add the offset value to heart rate affecting all parameters. This can be used as a simple way to partially obfuscate your real heart rate.
  • Undesired heart rate values is a list of values separated by ;. When heart rate matches any of the listed values, it will be adjusted to other nearest value not in the list. This affects all parameters. This may not work as intended for floats with adjusted range and floats using [0, 1] range when networked thru just 8 bits.
  • Random heart rate value will completely replace heart rate for all parameters with a random number in range of 1 - 255.

Test heart rate mode

Test heart rate mode allows you to simulate heart rate OSC data without connecting to Pulsoid. This is useful for testing your OSC setup or integrations without needing to have a heart rate monitor or a valid Pulsoid token.

When test mode is running, the app will generate oscillating heart rate values based on Min, Max, Step and Interval values.

Used Libraries

SharpOSC is a small library designed to make interacting with Open Sound Control easy (OSC).

net-mdns - A simple Multicast Domain Name Service.

wpf-notifyicon - NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform.

About

Simple tool for streaming heart rate from Pulsoid to OSC, with extra support for VRChat.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages