Difference between revisions of "Guide to OpenSesame"

From Phonlab
Jump to navigationJump to search
Line 9: Line 9:
 
[[File:SRBoxexample_overview.png|link=|border]]
 
[[File:SRBoxexample_overview.png|link=|border]]
   
First, text is displayed to the subject by the 'intro' text display item. By default items of this type wait for a keypress, but we change the default 'keypress' value of the Duration property to '0' to cause the script to immediately execute the following item.
+
First, text is displayed to the subject by the 'intro' text display item. By default items of this type wait for a keypress, but we change the default 'keypress' value of the 'Duration' property to '0' to cause the script to immediately execute the following item.
   
 
[[File:SRBoxexample_intro_props.png|link=|border]]
 
[[File:SRBoxexample_intro_props.png|link=|border]]
   
The next item is the intro_response srbox item, which is the interface to the button box. The script will wait here until an allowed response is provided. In this case only button 3 (the middle button) is allowed. The semicolon-separated list '1;3;5' indicates that button lights 1, 3, and 5 will illuminate.
+
The next item is the intro_response srbox item, which is the interface to the button box. The script will wait here until one of the buttons identified by the 'Allowed responses' property is pressed. In this case only button 3 (the middle button) is allowed. The semicolon-separated list '1;3;5' in the 'Turn on lights' property indicates that button lights 1, 3, and 5 will illuminate. The 'Allowed responses' property can also contain a semicolon-separated list.
  +
  +
The 'autodetect' value of the 'Device name' property identifies that OpenSesame should attempt to find the button box automatically.
  +
  +
The 'infinite' value of the 'Timeout' property means that the script will wait on this item until one of the allowed responses is received. During our script the intro text display therefore remains on the screen until an allowed response is received.
   
 
[[File:SRBoxexample_intro_response_props.png|link=|border]]
 
[[File:SRBoxexample_intro_response_props.png|link=|border]]

Revision as of 15:03, 9 October 2013

OpenSesame is an open-source software package for building and running psychology experiments. It's written in Python and is available for Windows, OS X, and Linux systems.

Using a button box with OpenSesame

The File:SRBoxexample.opensesame.tar.gz provides a demonstration of how to collect button presses in an OpenSesame experiment.

In this example the basic pattern of presenting a stimulus and waiting for a response proceeds in three steps. Take a look at the experiment overview:

Error creating thumbnail: Unable to save thumbnail to destination

First, text is displayed to the subject by the 'intro' text display item. By default items of this type wait for a keypress, but we change the default 'keypress' value of the 'Duration' property to '0' to cause the script to immediately execute the following item.

Error creating thumbnail: Unable to save thumbnail to destination

The next item is the intro_response srbox item, which is the interface to the button box. The script will wait here until one of the buttons identified by the 'Allowed responses' property is pressed. In this case only button 3 (the middle button) is allowed. The semicolon-separated list '1;3;5' in the 'Turn on lights' property indicates that button lights 1, 3, and 5 will illuminate. The 'Allowed responses' property can also contain a semicolon-separated list.

The 'autodetect' value of the 'Device name' property identifies that OpenSesame should attempt to find the button box automatically.

The 'infinite' value of the 'Timeout' property means that the script will wait on this item until one of the allowed responses is received. During our script the intro text display therefore remains on the screen until an allowed response is received.

Error creating thumbnail: Unable to save thumbnail to destination