Timing precision

Hello everyone,

I’m having a timing precision issue in my experiment. I would like to first start describing how my main routine is structured.

Below is the general structure of the routine. Three different faces are presented (for 2.6 seconds) and in some occasions, three different shapes are presented on top of the faces (but only during the last 1 second, meaning, from 1.6 to 2.6 seconds)

Below is my condition file. Only certain shapes are presented with certain faces. And I determine it by giving them duration values of 0 or 1. And the loop goes through that. I also have an iti that jitters. Its duration values are on the last coloumn.

ITI’s duration is indexed as such:

Face stimuli’s start time is indexed as $dur_iti ; so it starts right after ITI is finished. And duration is 2.6 seconds

Shape’s duration (it is only one shape here but the properties of the other two are identical) is indexed as, for example, $dur_square – which is “1” on excel. And the start time is $dur_iti + 1.6 so that it starts at the 1.6th second of face stimuli presentation.

And during some (not all) trials, things don’t work smoothly. Specifically, as I described above, my aim is that face is presented for 2.6 and only during the last 1 second, the shape is also presented with it. That means, both the shape and the face should disappear at 2.6th second and we move on to the next trial / face. However, sometimes the shape disappears before the face does. I tested the experience and I can recognize it. It disappears around ~ 30ms sooner, according to the log file. I know, it is very minimal. But timing precision is rather important for me.

You can see the log file below. Here the red coloumn includes the time when the shape “circle” stops. And blue coloumn includes the time when the face stimuli stops. If you look at the values in yellow circles, they should be identical but they are slightly different… I know the log file looks messy but this was just to demonstrate the evidence of the problem. And as said, some trials do not have the problem.

Is there maybe a way to start / end the stimuli, based on another stimuli? For example, can I write something in the “duration” box of the shape stimuli to indicate that it can stay there until the face stimuli stops? Would this result in more precise timing?

Or, any other ideas would be greatly appreciated!

Thank you so much, and apologies for this long message….

Okay I think I have solved my own problem - even though not sure if it is the best solution but, seems like it is working…

To describe what I have done:

  • I put this in the “duration” box (set for “condition”) of my shape stimuli: $face_acq.status==FINISHED to indicate that I want the shape to stop when the face stimuli stops (so, I’m not indexing my excel file anymore)
  • However, due to the fact that I don’t want all of the three shapes to be presented at once, I still had to do something to make only certain shapes appear. I used this code:
if shape == "circle":
elif shape == "square":
elif shape == "hexagon":

elif shape == "none":

(code credit: @JensBoelte - from another topic - Thanks again!)

(I created another coloumn in my excel file called “shape”)

If not clear, please feel free to reach out and I can explain again (in case you are having a similar issue)