OSC Streaming | Petal Metrics Documentation (original) (raw)

Stream Muse data to other applications using Open Sound Control (OSC) protocol.

What is OSC?

OSC (Open Sound Control) is a protocol for communication between computers, synthesizers, and other multimedia devices. It's widely used in:

Enabling OSC Streaming

  1. Open SettingsOutput
  2. Find the OSC Streaming section
  3. Toggle Enable OSC
  4. Configure host and port:
    • Host: IP address of receiving application (default: 127.0.0.1)
    • Port: UDP port number (default: 9000)
    • Stream Name: Identifier for your stream (default: PetalStream)

Settings Persistence

Your OSC configuration is automatically saved and will be restored the next time you launch the app.

OSC Addresses

Petal Metrics sends data to the following OSC addresses:

EEG Data

/muse/eeg [float, float, float, float]

Four channels: TP9, AF7, AF8, TP10 (in microvolts)

Accelerometer

/muse/acc [float, float, float]

Three axes: X, Y, Z (in g units)

Gyroscope

/muse/gyro [float, float, float]

Three axes: X, Y, Z (in degrees/second)

PPG (Muse S only)

/muse/ppg [float, float, float]

Three channels: Ambient, IR, Red

Battery Level

Battery percentage (0-100)

Example: Receiving in Python

from pythonosc import dispatcher, osc_server

def eeg_handler(address, *args):
    tp9, af7, af8, tp10 = args
    print(f"EEG: TP9={tp9:.2f}, AF7={af7:.2f}, AF8={af8:.2f}, TP10={tp10:.2f}")

def acc_handler(address, *args):
    x, y, z = args
    print(f"Accelerometer: X={x:.2f}, Y={y:.2f}, Z={z:.2f}")

disp = dispatcher.Dispatcher()
disp.map("/muse/eeg", eeg_handler)
disp.map("/muse/acc", acc_handler)

server = osc_server.ThreadingOSCUDPServer(("127.0.0.1", 9000), disp)
print("Listening for OSC on port 9000...")
server.serve_forever()

Example: Receiving in Max/MSP

  1. Create a udpreceive 9000 object
  2. Connect to OSC-route /muse/eeg /muse/acc /muse/gyro
  3. Unpack the data with unpack f f f f (for EEG) or unpack f f f (for motion)

Example: Receiving in TouchDesigner

  1. Add an OSC In CHOP
  2. Set the port to 9000
  3. Data appears as channels automatically

Network Streaming

To stream to another computer on your network:

  1. Find the IP address of the receiving computer
  2. Set Host to that IP address (e.g., 192.168.1.100)
  3. Ensure the port is open in the receiving computer's firewall

Firewall Settings

You may need to allow UDP traffic on your chosen port through your firewall.

Troubleshooting

No data received

Data is choppy or delayed

Availability

OSC streaming is available on all subscription plans (Basic, Standard, Advanced).