| Reference | Downloads | Github

Movie in Background with Random Stimuli

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): Builder v2021.2.2
Standard Standalone? (y/n) If not then what?: Y

What are you trying to achieve?: I am trying to make a Psychomotor Vigilance Task (PVT). I want to have a video of a driving scene playing continuously in the background while polygons appear at random intervals for participants to respond to.

Here is the sequence I am trying to achieve:

  1. video playing in background
  2. dot to appear in the middle of the screen
  3. participant responds with RT recorded, dot disappears on key input
  4. between 5-10 seconds following that dot disappearing, another dot appears
    (repeat 2-4 for the duration of the video / about 15 minutes)

I can get the video to play and understand how to use the key input to make the polygon disappear and record RT, but am unsure on how to make the polygons appear at random intervals without interrupting the background video or changing the routine/loop.

Any thoughts or suggestions on how to set up the polygon?? THANK YOU!!!

I never used Builder before, but figured this would be something I could figure out. More experienced users may have better solutions, as there are surely multiple ways to achieve this, but here is a solution that I believe requires the least amount of coding.

Add a routine before the trial loop and to that add a movie stim called bg_video. Pick your video file and set the duration to 0.

In your trial routine where you will display the dot and look for keyboard input (and in any other routine that you want the background video to play), add a Code component. In the Each Frame tab of that code component, add:


Here is a build that does what I think you need: GitHub - domstoppable/pvt: A demonstration of a psychomotor vigilance task with a movie playing in the bac