ESP8266 Muse Monitor OSC Receiver Example


#1

I’ve had a few people ask me to build hardware to control lighting from Muse Monitor’s OSC data stream for interactive events.

This is super easy to do with a WiFi SOC (System On Chip) called an ESP8266, so for those who are interested here is some demo code and instructions for building the hardware.

When it starts up, it’ll show you a splash screen showing which WiFi access point it connected to, what it’s IP is (to be entered into Muse Monitors OSC Stream Target IP) and then it’ll wait to receive data.

Once it starts receiving data, it’ll show the screen above. In the top right is a horseshoe indicator, showing if the headband is on (top center) and four colored circles showing red/green for the headband fit.

At the bottom is a live bar chart showing relative brainwaves for Delta, Theta, Alpha, Beta and Gamma.

I’ve tried to make the code as easy to read as possible, so for anyone who is interested, it should be a simple matter to add some code in to control lighting, make a servo move, or anything else you can think of really! If you want it make some toast when your Alpha level reaches a certain point, you just need to add a power relay and a few lines of code. Have fun! :slight_smile:

Features:

  • Splashscreen showing Wifi SSID Name, IP Address and Port.
  • Live OSC bundle message processing from Muse Monitor.
  • Autodetection of Single or four channel absolute waves (/muse/elements/*_absolute).
  • Horseshoe indicator showing headband fit (/muse/elements/horseshoe, /muse/elements/touching_forehead).
  • Relative brainwaves (Delta, Theta, Alpha, Beta, Gamma) calculated from absolutes.
  • Automatic timeout to splash screen when no data received.