Alternative to Loops for precise timing
Hello. First i wanted to thank the OpenSesame team for all their work on this free software.
I'm trying to implement a n-back task, and i'm having trouble with the timing. What i want to do is
1) Display an image for 250ms
2) Display an blank image for 250ms
3) Recording if the spacebar has been pressed during either the picture or the blank image. Regardless of if the spacebar has been pressed or not, the picture and the blank image should be shown for 250ms each
4) Logging the Data
5) Starting over, with a different image.
I need to show around 420 pictures (3 minutes 30 seconds). The pictures and their order will be the same for every participant, so i don't need the loop randomization.
Below i've shown how i proceeded. Basically i show the picture, create a kb response with 245ms timeout, and the wait script is: self.sleep(245-self.get('response_time')). Then i show the blank picture, create another kb response for 245ms, and the same wait script. Finally i log the variables. I'll have two kb response in the log file, but it's not a problem to combine them into one.
The "All_Trials_Same_Duration" script is something i've taken from another post on the forum, and what is basically does is: if the trial took less than (something) ms, wait for (something - trial_duration).
My problem is the following: this solution prevent jitter, but the duration of trial + preparation is something around 1200ms, which is way too much for me.
I read timing documentation and other similar questions but the answer seems to be to use sequence item. However this means i have to create 420 times the same code, which seems extremely impractical. Is there a simple solution to my problem i've overlooked? I am just familiar with python, but i have access to colleagues with python experience (but no open sesame experience). I can also allow some small timing imperfections if there's no other way around it.
Thank you in advance for your answers.
Comments
Up
I don't think you need the wait scripts
Could You upload your experiment?
Then I can try to play around with it