Skip to content
forked from moostrik/ofxLSL

openFrameworks addon for LabStreamingLayer

Notifications You must be signed in to change notification settings

EmotiBit/ofxLSL

 
 

Repository files navigation

About ofxLSL

  • 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.dll and for linux you will need the liblsl-1.14.0-manylinux2010_x64.so

Example for generating marker stream

You may generate a marker stream using the marker.py example in markertest/py folder.

About the exmaples

  • Marker.py
    • begins stream that alternates printing "Hello" and "World"
    • Tags sent aproximately every 1.5 sec

Requirements

To run the marker.py example, you will need the following:

  • Install Python
    • We recommend downloading anaconda to create and manage virtual environments.
    • Create an new environment using python 3.7.
      • Follow the instruction on docs.anaconda to create an environment.
  • Install the following Python packages
    • Open anaconda prompt.
    • Activate the environment created in the previous step.
      • To activate, type conda activate your_env_name to activate.
    • psychopy
      • Run pip install psychopy
    • liblsl

Running the example

  • 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.

Usage Notes

  • By deafult, the markey.py, example generates the LSL stream with the name DataSyncMarker and 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!

Example to read LSL markers

  • You may use the ReadMarkerExample example 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 below
    • receiveString = std::make_shared<ofxLSL::Receiver<string>>("stream_name", "stream_id");
    • Example
      • receiveString = std::make_shared<ofxLSL::Receiver<string>>("DataSyncMarker", "123345");

Notes

  • For Windows users
    • Make sure the lsl.dll file is in bin folder when running the example.

About

openFrameworks addon for LabStreamingLayer

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 57.4%
  • C 30.4%
  • Makefile 7.5%
  • QML 2.6%
  • Python 2.1%