The following guide describes how Psychopy send marker to EMOTIV LSL Interface.
- Install python3 (version 3.7 or later)
- Install pylsl (the Python interface of LSL)
pip install pylsl
-
Open SendMarker.py file and run
-
Open Emotiv Pro app then connect to 'PyMarker' stream on EmotivPro Inlet setting as below:
The example will create a LSL Outlet stream have 3 channels. Each event is array containing MarkerTime, MarkerValue, CurrentTime. The markertime of marker will be loaded from sending_marker.csv randomly. A marker is sent to LSL every 1000ms. In the example, a marker value is a random number from 1-99.
# Set up LabStreamingLayer stream.
info = StreamInfo(name='PsychoPyMarker', type='Markers', channel_count=3,
channel_format='double64', source_id='unique012345')
chns = info.desc().append_child("channels")
#MarkerTime is the time you want to add a marker. It is an epoch time.
#MarkerValue is value of marker.
#CurrentTime is current time at epoch time
for label in ["MarkerTime", "MarkerValue", "CurrentTime"]:
ch = chns.append_child("channel")
ch.append_child_value("label", label)
ch.append_child_value("type", "Marker")
info.desc().append_child_value("manufacturer", "PsychoPy")
outlet = StreamOutlet(info) # Broadcast the stream.
-
Go to Lab Streaming Layer page, Outlet tab in EmotivPRO, choose the desire Data stream type and Data format Click Start button to start streaming.
-
Open ReceiveData.py file and run
-
[Py LSL Example] ( https://github.com/labstreaminglayer/liblsl-Python/tree/master/pylsl )