Psychopy and labstreaminglayer (LSL) on Windows 7 (64-bit)

609 views
Skip to first unread message

Christoph Justen

unread,
Jun 4, 2015, 6:56:36 AM6/4/15
to psychop...@googlegroups.com
Hi there,

I am a newbie to Psychopy/Python and I have a question regarding Psychopy2 and the labstreaminglayer (LSL, https://code.google.com/p/labstreaminglayer/) on Windows 7 (64-bit):

Is it possible to implement LSL into Psychopy2? If yes, how can this be done?
Your help would be very much appreciated.

I am looking forward hearing from you soon.

Best,

Christoph

Jithin Sam Varghese

unread,
Nov 23, 2016, 4:54:52 AM11/23/16
to psychopy-users
Hello,

I had the same issue until recently. Will post as a reply here even though it is an old thread.

STEPS:

1. Download the pylsl package from https://pypi.python.org/pypi/pylsl
2. Unzip it into a folder on your computer. I unzipped it to a folder in My Documents:
C:\Users\******\Documents\Python\pylsl
3. Go to Psychopy > File > Preferences > General > paths
Insert your folder url in quotes, ie 'C:\Users\******\Documents\Python\pylsl' . 

Now, go to your "Compile Script" view where you can see the Python code:
I wish to send markers into my EEG viewer:

from pylsl import StreamInfo, StreamOutlet
import time
import random

print ("Creating a new marker stream info...\n")
info = StreamInfo('PsychoPy','Markers',1,0,'int32','myuniquesourceid23443')

print("Opening an outlet...\n")
outlet =StreamOutlet(info)

print("Sending data...\n")

#Initialize the marker vector:
vec = []

#Inside the loop:
mkr = trials.thisIndex
vec.append(mkr)
outlet.push_sample(vec)

Hope this answers your question. Feel free to reach out to me. I would be happy to help with whatever I know.

Best,
Jithin
Reply all
Reply to author
Forward
0 new messages