🌉 OSC Bridge Setup Guide
This guide will help you set up a local OSC bridge to receive EEG data from the Muse-js-Athena demo in your favorite applications (Max/MSP, TouchDesigner, Pure Data, etc.)
📥 Download Files
🚀 Quick Setup (3 Steps)
Step 1: Create a folder and save the files
- Create a new folder on your computer (e.g., "muse-osc-bridge")
- Save both downloaded files into this folder
- Make sure
package.json
is named exactly that (not osc-package.json
)
Step 2: Install and run
Open a terminal/command prompt in your folder and run these two commands:
First, install dependencies:
npm install
Then, start the bridge:
node osc-bridge.js
You should see:
🌉 OSC Bridge Server Started
WebSocket listening on port 9000
Forwarding OSC to localhost:5555
Step 3: Configure the Muse demo
- In the Muse demo, the OSC URL should already be set to:
ws://localhost:9000
- Check the "Enable OSC Output" box
- Connect to your Muse device and start streaming!
✅ Success! EEG data is now streaming to localhost:5555
via UDP
📊 Receiving OSC Data
Configure your application to receive OSC messages on:
- Host: localhost (or 127.0.0.1)
- Port: 5555
- Protocol: UDP
OSC Message Format
/muse/eeg ffff [timestamp, ch1, ch2, ch3, ch4]
/muse/optical fff [timestamp, ch1, ch2, ch3, ...]
/muse/imu ffffff [timestamp, accelX, accelY, accelZ, gyroX, gyroY, gyroZ]
/muse/battery f [battery_percentage]
🔧 Advanced Options
You can customize the ports when running the bridge:
node osc-bridge.js [websocket-port] [osc-host] [osc-port]
# Examples:
node osc-bridge.js 9001 localhost 5556 # Custom ports
node osc-bridge.js 9000 192.168.1.100 5555 # Send to another computer
❓ Troubleshooting
- "Cannot find module 'ws'" - Make sure you ran
npm install
first
- "Address already in use" - Another program is using port 9000. Try a different port or close the other program
- No data received - Make sure the OSC bridge shows "Client connected" when you enable OSC in the demo
- Connection refused - Make sure the OSC bridge is running before enabling OSC in the demo
📚 Application Examples
Max/MSP
Create a [udpreceive 5555]
object
TouchDesigner
Add an "OSC In" DAT with port 5555
Pure Data
Use [netreceive -u -b 5555]
← Back to Muse Demo