- EmotiBit can synchronize data with LSL by reading timestamps from a marker stream.
- A marker stream is an LSL stream, that periodically spits out timestamped markers. These timestamped markers are picked up by EmotiBit, to sync EmotiBit data to local computer clocks on the LSL network.
- This version of ofxLSL is based on lsl
1.14.0- The lib files required for LSL to work can be grabbed from the release linked above. Ex. for windows, you will need the
lsl.dlland for linux you will need theliblsl-1.14.0-manylinux2010_x64.so
- The lib files required for LSL to work can be grabbed from the release linked above. Ex. for windows, you will need the
You may generate a marker stream using the marker.py example in markertest/py folder.
- Marker.py
- begins stream that alternates printing "Hello" and "World"
- Tags sent aproximately every 1.5 sec
To run the marker.py example, you will need the following:
- Install Python
- We recommend downloading anaconda to create and manage virtual environments.
- Get anaconda from their website: https://www.anaconda.com/
- Create an new environment using python 3.7.
- Follow the instruction on docs.anaconda to create an environment.
- We recommend downloading anaconda to create and manage virtual environments.
- Install the following Python packages
- Open anaconda prompt.
- You may refer docs.anaconda to do so.
- Activate the environment created in the previous step.
- To activate, type
conda activate your_env_nameto activate.
- To activate, type
- psychopy
- Run
pip install psychopy
- Run
- liblsl
- Follow the instructions on liblsl-Python page: https://github.com/labstreaminglayer/liblsl-Python#installation
- Brief instructions,
- Run
conda install -c conda-forge liblsl - Run
pip install pylsl
- Run
- Open anaconda prompt.
- In the conda command prompt, with the correct environment activated, run the command
python marker.py - You will see a window pop up with the words "Hello" and "World" alternating.
- By deafult, the
markey.py, example generates the LSL stream with the nameDataSyncMarkerand source_id =12345- You can change the name and stream_id of the marker stream to your needs, but remember to change the name appropriately at the receiver as well!
- You may use the
ReadMarkerExampleexample to test marker streams on the LSL network.- The Visual studio project files have been included (for easy build on Windows)
- This example searches for (and connects to) the specified LSL stream.
- The stream should be specified in
ofApp.cpp, as shown belowreceiveString = std::make_shared<ofxLSL::Receiver<string>>("stream_name", "stream_id");- Example
receiveString = std::make_shared<ofxLSL::Receiver<string>>("DataSyncMarker", "123345");
- For Windows users
- Make sure the
lsl.dllfile is in bin folder when running the example.
- Make sure the