psychopy.org | Reference | Downloads | Github

Display second image in routine upon keypress

If this template helps then use it. If not then just delete and start from scratch.

OS: Win10
PsychoPy version: 2021.2.3

I have a routine which displays an image and asks the participant to move a slider, then press the space bar to move on. In between the trials of these routines I need a mask, which is custom and is loaded from a .csv. When the spacebar is pressed, I need the mask to appear for 1 second then for the routine to move onto the next trial.

I feel like this is a custom code job. I have tried this, but when I tried to run it psychopy couldn’t find any of the image stimuli for some reason.

Any help in the right direction would be much appreciated.

Easiest way to do this is probably to just split them into multiple routines (one for the slider stuff, one for the mask), so long as the mask routine is in the same loop it will start immediately after the other routine :slight_smile:

1 Like

Hi Todd,

I thought about this, but the problem is that there are ~200 trials, and psychopy randomises the order for them each time the experiment is run; one of my factors is the size of the stimulus in each trial, and the mask that appears has to be the same size as the stimulus.

Do you know of any way to ask psychopy to randomise each with the same seed each time?

thanks

Could you share the psyexp file? These factors should be the same so long as the two routines are in the same loop, though you could also just set the mask size to be $stimulus.size to match the size each repeat.

Cheers mate! I did what you suggested originally and for whatever reason it’s randomising them in the same order, so all is well.

Thinking about it I’m assuming it’s because rows in the .csv are being randomised by the loop. Wish I’d thought of that earlier haha. Thanks again

1 Like