EmotivBCI
  • EmotivBCI
  • Getting started
    • System requirements
    • Installing and Updating
    • Logging in
    • Create an account
    • Forgot password
    • Access account
    • Logging out
    • Offline use
  • Setting up your EEG device
    • Connecting your headset
      • USB Dongle Connection
      • Bluetooth Connection
      • Connecting EPOC Flex
    • Disconnecting your headset
    • Fitting your headset
    • Contact quality map
      • Contact Quality (CQ) vs. EEG Quality (EQ)
    • EEG quality indicator
    • Battery indicator
    • EPOC+ and EPOC X configurations
  • Demographic data collection
  • Menu and navigation
  • Training profiles
    • Your training profiles
    • Creating a training profile
    • Changing training profile
    • Editing training profile name
    • Deleting training profile
    • Guest mode
    • Readonly training profile
    • Convert readonly training profile
  • Mental Commands
    • Overview
    • Training neutral
    • Training your first command
    • Accept or reject training
    • Training feedback
    • Command level
    • Brain Space Diagram
    • Adding new commands
    • Deleting commands
    • Deactivating commands
    • Training modes
    • Live mode
    • Adjusting sensitivity
    • Tips and Tricks
  • Facial Expressions
    • Overview
    • Training facial expressions
    • Training neutral
    • Training your first expression
    • Expression level
    • Adding new expressions
    • Delete expression
    • Live mode
    • Adjusting sensitivity
    • Use default detections
  • Performance Metrics
    • Overview
    • Definitions
    • Frequency rate
    • Turn streams on/off
    • Toggle all streams on/off
  • Motion sensors
    • Overview
    • Definitions
    • Frequency rate and resolution
    • Turn streams on/off
    • Toggle all streams on/off
  • OSC
    • Example connection with MaxMSP
  • Release notes
    • v2.0
    • v2.1
    • v2.2.1
    • v2.3
    • v2.4.1
    • v2.5
    • v2.6
    • v2.6.1
    • v2.6.2
    • v2.6.3
    • v2.7
    • v2.7.1
    • v3.0.0
    • v3.1.0
    • v3.2.0
    • v3.6.5
    • v3.6.8
    • v3.7.0
Powered by GitBook
On this page
  1. OSC

Example connection with MaxMSP

PreviousOSCNextRelease notes

Last updated 1 year ago

Once you subscribe to the OSC module, the tab is enabled in BCI. The following example demonstrates a connection of EMOTIV BCI with MaxMSP, which is a visual programming language for music and multimedia.

  1. Connect a simulated device (create one on EMOTIV Launcher if you don't have. See ) or an OSC compatible EMOTIV Brainwear®

  2. Choose a to connect to the external device.

  3. Select Sending mode: Unicast to Self

  4. Set the IP: 127.0.0.1

  5. Set the Port: 8000

  6. Choose the Data stream you want to connect: Facial expressions, Mental Commands, or Performance Metrics

  7. Click Start

  8. Open Max MSP, go to File > Package Manager and install CNMAT Externals

  9. Go to and check the table with OSC Address Patterns

  10. Create (replicate) the nodes below and change OSC-route according to whichever OSC Pattern you wish to address (in the example image, Facial expressions/Smile) - check table in the previous step for the addresses.

  11. Open Processing and go to Sketch > Import Library… > Add Library , search and install oscP5

  12. Open a new File.

  13. Import oscP5 to the code and initialize an instance listening to port 12000. Example code (copy and paste in Processing):

    import oscP5.*; //OSC receive OscP5 oscP5; // This value is set by the OSC event handler float importedValue = 0; float radius; void setup() { size(1200,1000); // Initialize an instance listening to port 12000 oscP5 = new OscP5(this,8500); } void draw() { background (0); // Scale up imported value radius = importedValue * 1000; // Display circle at location vector stroke(255); strokeWeight(2); fill(255); ellipse(500,500, radius, radius); println(radius); } void oscEvent(OscMessage theOscMessage) { float value = theOscMessage.get(0).floatValue(); importedValue = value; }

14. Click the Play button and watch the graphics change according to Smile. importedValue is associated with the circle radius.

15. Open any example code in File > Examples.. 16. Associate importedValue with any float variable from any Library to play around. Be sure to:

  • Import oscP5;

import oscP5.*; //OSC receive OscP5 oscP5; // This value is set by the OSC event handler

  • Initialize importedValue (before void setup);

float importedValue = 0;

  • Initialize oscP5 (place it inside void setup);

// Initialize an instance listening to port 12000 oscP5 = new OscP5(this,8500);

  • Associate the event with the variable importedValue (place it after void draw);

void oscEvent(OscMessage theOscMessage) { float value = theOscMessage.get(0).floatValue(); importedValue = value; }

Creating a virtual brainwear
training profile
https://github.com/Emotiv/opensoundcontrol/tree/master