Sending Triggers via LSL
I have been working to try to sync triggers to a NIRx NIRSport system via Lab Streaming Layer.
I have initialized my experiment with an in-line script using the following lines
from pylsl import StreamInfo, StreamOutlet # import required classes info = StreamInfo(name='TriggerStream', type='Markers', channel_count=1, channel_format='int32', source_id='Example') # sets variables for object info outlet = StreamOutlet(info) # initialize stream.
This code works perfectly in PsychoPy, and does actually connect my device to the recording software. I am able to verify this on the other end, so I am hesitant to believe I am missing any libraries or have miscoded anything.
I then add an additional in-line script with the following code
to send the trigger.
Strangely, if I highly only the outlet.push_sample(x=) the trigger sends perfectly. But when the experiment is run, the triggers seem to be passed directly over. The fact that I can send the triggers by directly calling the code, again leads me to believe the script at least has no errors, I am wondering if there is something in the pipeline itself that I am failing to include.
I have worked to simplify my experiment to use no loops, and only initializes, verifies the connection, and sends the trigger, yet no triggers are sent.
Does anyone have experience, or even better a sample script using LSL?
I appreciate all the help that I could get.