Hello there,
I am presenting a stimulus for e.g. 60 seconds, and I want to send LSL markers every 2 seconds.
The approaches so far, using the code component:
Have 30 trials and push a LSL stream on each one, while keeping the same stimulus on screen (quick and dirty, not easily trasferable to new experiments).
Have a countdown timer and on each frame update, check if we surpassed the 2-sec limit (losing precision according to screen refresh rate).
What would be a clean way to keep better precision, without overcomplicating the logic of the task?
Thanks in advance!
Hello @JungleHippo
It is not quite clear what you are asking. How to send LSL-marker every 2 seconds? How to set up a count-down timer? How to check the 2 second limit?
nFrames = round((int(expInfo['frameRate']) / 1000) * 2000)
The code above provides the number of frames for a two-second duration, regardless of the refresh rate. For example, two seconds corresponds to 120 frames when using a monitor with a 60 Hz refresh rate. If the frame duration is stable, the frame rate is 60 Hz, anhd you use the number of frames for your interval, the duration is 2000 ms (120 * 1000 / 60).
Best wishes Jens