OSC Streaming
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:
- Music and audio software (Max/MSP, Pure Data, Ableton Live)
- Visual programming (TouchDesigner, Processing)
- Research tools (MATLAB, Python)
- Game engines (Unity, Unreal)
Enabling OSC Streaming
- Open Settings → Output
- Find the OSC Streaming section
- Toggle Enable OSC
- 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)
- Host: IP address of receiving application (default:
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
/muse/batt [float]
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
- Create a
udpreceive 9000object - Connect to
OSC-route /muse/eeg /muse/acc /muse/gyro - Unpack the data with
unpack f f f f(for EEG) orunpack f f f(for motion)
Example: Receiving in TouchDesigner
- Add an OSC In CHOP
- Set the port to
9000 - Data appears as channels automatically
Network Streaming
To stream to another computer on your network:
- Find the IP address of the receiving computer
- Set Host to that IP address (e.g.,
192.168.1.100) - Ensure the port is open in the receiving computer's firewall
You may need to allow UDP traffic on your chosen port through your firewall.
Troubleshooting
No data received
- Verify OSC is enabled in Settings
- Check host and port match your receiving application
- Ensure firewall allows UDP on the specified port
- Confirm your subscription includes streaming features
Data is choppy or delayed
- Use a wired network connection if streaming to another computer
- Reduce the number of applications processing the data
- Check CPU usage on both computers
Availability
OSC streaming is available on all subscription plans (Basic, Standard, Advanced).