coroutine inline script trigger response time incorrect
Hi :)
I have a Go-No-Go-Task with EEG so every stimulus-presentation and every response needs to trigger a signal for my eeg-program to write the exact time a stimulus or a response was given.
I build a coroutine for my trials and it works like this: A fixation-cross is presented for a random time (200;300 ms), stimulus is presented for 750 ms and then a black screen follows for 500 ms. As soon as the stimulus is presented the participant can give a response via space and this also stopps the trial/coroutine and starts the next one. Everything worked fine. Now I inserted an inline script for the trigger (stimulus onset and response) and now the responsetime is shorter by the duration of the fixation cross.
This is the inline script that sets the times for the coroutine:
This is the coroutine. (imediatly after the coroutine, the logger-item is run after the coroutine at the end of every trial)
This is the inline script for the trigger at stimulus onset:
This is the inline script for the trigger whenever a response is given (This is run after the coroutin, after the logger-item)
Thank you so much for this wonderful forum! It saved me many times! I didn't find any other entry that covered a problem like mine.
Thank you so very much for everything you guys do!
Leonie
Comments
Hi,
What exactly is your problem? That adding triggers changes the response time? I don't know for sure. I am not very experienced with Co-routines, but your inline code looks that it might be a little heavy time-wise (establishing connections for example?). Have you seen the docs on co-routines? In particular the part on inline_scripts? You could experiment a little and systematically manipulate the time you sleep in that script. Does the error in response time match that time? If so, you know what is going on.
I guess it might be necessary to avoid co-routines for that purpose and rather implement your own co-routine-like loop. It's not too difficult, if you share your code, I can try to help with it.
Good luck,
Eduard