vlog

PsychoPy is an open-source program for building stimulus-response and reaction-time experiments.

 

About research in Psychological and Brain Sciences

Framework

Screenshot of the PsychoPy program

A PsychoPy experiment is broken down hierarchically. The basic unit is called a Routine—this is what is being edited in the blue area labeled 1 in the screenshot.

A Routine is made up of any number of Components, selected from the green-outlined panel labeled 3 in the screenshot. Once selected, the Components appear in rows within the Routine panel.

Some common components include:

  • Text stimuli
  • Image stimuli
  • Audio/video stimuli
  • Keyboard responses

You can see a text stimulus Component and a keyboard response Component in the screenshot.

All Components have a specified time within the Routine to start—the time of stimulus presentation or the time it will start listening for a keyboard response. The time that each Component will be active is displayed as the semitransparent blue bar on its row.

Multiple Routines are then joined together according to the experiment Flow, the gold-outlined box at the bottom labeled 2. Each of the red or green blocks is a single Routine. For Routines that are repeated trials, they are in a Loop (as can be seen for the second Routine in the screenshot). 

Each Loop also needs a separate file to specify the Loop parameters. This can be an Excel or comma-delimited file (CSV), with a row for each trial in the Loop plus a header row, and a column for each different thing that can change per trial within the Loop.

For instance, when specifying what text will be displayed for a text stimulus Component, if you put $textStim1 as the value and selected “set every repeat”, it would look for a column header textStim1 in the Loop parameter file, and set the value of the text to one of the cells in that column for each new time through the Loop.

A Routine need not be looped, however; if you want to display instructions, you can create a Routine with a single text stimulus Component containing the instructions and add it to the Flow without a Loop.