General Purpose Psychology Laboratory

Dr. Robert Goldstone

Psychology Department/Program in Cognitive Science

Indiana University



This laboratory is designed to run many different kinds of experiments involving words, pictures, and sounds. The pictures and sounds that you want to use in an experiment are stored in one file that can be accessed using the freeware program "Resedit." A second file has a list of all of the trials that you want to expose to a subject. Each trial is made up of one or more displays, and each display describes what will appear, where it will appear, how long it will appear, what the correct response is to it.

Creating Picture and Sound Files

If you only want to show words and symbols to subjects, then you can skip this section. If you want to show pictures or sounds, you need to create the materials in a program and then combine all of the stimuli together in one "Resedit" file. "Resedit" stands for "Resource Editor" and a resource is just a structure that contains special information such as pictures or sounds. Pictures are stored in a Resedit resource called "PICT" and sounds are stored in a resource called "snd." Each picture or sound has an ID number attached to it. You will need to refer to this number when you want to show the picture or play the sound. Here are the steps you need to take to make a file of pictures:

    1. Run Resedit (by double clicking on its icon)
    2. Select "New" under the "File" menu
    3. Specify a name for the new file of pictures
    4. Find a picture that you want to paste into the picture resource. This picture can be created in any graphics program, or can be copied from the web. It should be in PICT, JPG, or GIF format. If it is not, you will have to convert it somehow. You will want to select and "COPY" the picture into the computer's memory, and then paste it into the resource. Often times, the "Copy" and "Paste" commands are located in "Edit" menus inside programs. To find the picture, you will most likely have to temporarily leave Resedit (but don't quit it), and enter another program. Both programs can be running at the same time.
    5. Once the picture has been copied into memory, go back into Resedit and select "Paste." If you succeeded in storing a picture in memory, then Resedit will automatically create a PICT resource, and opening this resource will reveal all of the pictures in your file. There will only be one picture so far.
    6. Resedit will automatically assign an ID number to your picture. To change the ID, select the resource's window and under the "Resource" menu, select "Get Resource Info." From here, you can view or change the ID number.
    7. Repeat steps 4-5 to store more pictures in your file.

The same procedure is used for sounds, except that the format of the sound should be "snd," and the sounds will be stored in a "snd" resource rather than a "PICT" resource.

Creating Files of Trials

The bulk of the work in creating an experiment is deciding what will happen on each trial. A simple text file is written by the experimenter and read by the laboratory software. This file contains a description of each trial. It has a very specific format, as shown here:

A number of notes of explanation should be given;

  1. The first line of the data file contains a single number that is the number of trials contained in the file.
  2. Each trial may contain up to 10 displays. Before the displays are described, three pieces of information must be given about the entire trial: the number of displays in it, the key to press on the keyboard that is the correct response, and type of trial. The computer will only accept keys that are listed in one of the trials. When the experimental results are being displayed, the computer will tabulate results separately for each of the different trial types that have been specified in the file. In the example above, the computer would show separate results from "abstract" and "concrete" trials. The labels given to trial types should have no spaces in them.
  3. The first word of each display describes what kind of material is presented, and must be one of the following: "word," "picture," "sound," or "blank." "Blank" simply shows a blank screen for a specified duration.
  4. If a word is displayed, the next entry shows this word. An entire phrase can also be presented (but should not include any of the words "center," "position," or "random"). Each display line may only contain 255 characters. If a sound or picture is presented, the next entry gives the resource number in the resedit file for the item.
  5. The next piece of information tells the computer where to present the item. This entry is left off for "blank" or "sound" trials. If "position" is specified, then it must be followed by a horizontal (first) and vertical (second) location. Your screen dimensions may be 1024 X 768, so do not specify values beyond the screen. These numbers should be integers.
  6. The final entry for a display is its duration, which is specified in seconds. If "0" is specified, then the image will stay on the screen until a key is pressed. A duration is not specified for sounds because the sound continues until it is finished.
  7. The empty lines between trials are not required, but a blank line at the end of the file is required.

Here is a small file that you should now be able to understand. It runs an experiment testing whether people can judge whether or not something is a word better if it is preceded by a related word.


2 y related

word nurse center 0.5

word doctor center 0

2 y unrelated

word wombat center 0.5

word doctor center 0

2 n nonword

word nurse center 0.5

word tordoc center 0

2 n nonword

word wombat center 0.5

word tordoc center 0

More formally, the syntax for the file of trials looks is expressed below. In the following notion, bold words must appear exactly as shown, and options are placed between parentheses with each option surrounded by "<" and ">," and separated by commas such as (<left>, <right>, <up>, <down>):

number of trials

number-of-displays-in-Trial-1, correct-response-key, one-word-category

(<word word-or-phrase (<center>, <random>, <Position x-coordinate y-coordinate>) duration>,

<picture resource-number (<center>, <random>, <Position x-coordinate y-coordinate>) duration>,

<sound resource-number> ,

<blank duration>)

....for each display within Trial 1

number-of-displays-in-Trial-2, correct-response-key, one-word-category

....for each trial.

blank line at end

Setting Up the Experiment

When you select "Trial Details" under the "Set up" menu, you will see a window that looks like:

By changing the options in this window, you can customize various aspects of the exeriment.

Repetitions of each trial: You can present each trial more than one time. This is often done to get more reliable results from an experiment with few trials.

Give Feedback? If you give feedback, then after a subject has made a response, the computer will compare their response to the correct key press stipulated in the file. If the subject gave the correct response, a check appears; otherwise, an "X" appears.

Leave old display on when drawing new? If a trial has more than one displays in it, you can choose to not erase the screen after the first display has been presented. if so, then both displays will appear together.

Blank period between trials. With this option, you can specify in milliseconds (1/1000ths of a second) how much of a pause to give subjects between trials.

Order of displays within trial. If a trial has more than one display, you can either present the displays in the same order that they appear in the file, or you can randomly present the displays.

Trial order. Similarly, trials can be presented in the same order that they appear in the file, or can be presented randomly.

Ranges for random display positions. If the "random" option is specified in a file for the location of an item, then it will appear somewhere within a box around the center of the screen. The horizontal and vertical numbers specify the dimensions of this box. For example, if a horizontal value of 50 is selected, then the item will appear somewhere between the location 25 pixels left of center and 25 pixels right of center.

Prompt string. After all of the displays within a trial have been presented, you can choose to present a prompt string to subjects. The prompt string would typically describe to subjects what their possible response choices are.

Under the "Set up" menu, there is a second menu option entitled "Specify Files." Use this option to define the various files used in the experiment. For all of the files specified here, you can type in names at the keyboard, or use the "Open" button to search for the file that you want.

File of trials. This contains the text file with the trial descriptions. It should be a generic text file, and not, for example, a Microsoft Word file. You can, however, use Microsoft Word to create the file. Just be sure to use the "Save As" command when saving your file, and specify under the "save" options that the file should be a "text only" file.

Resource file of pictures and sounds. This should be a file made in Resedit that contains the picture and sounds that you want to tuse.

File for experimental results. When you finish an experiment, the computer will save your results to the file specified here. In addition, it will show the results on the screen.

Font Menus

There are two menus that control the font style and size of words during the experiment. Changing fonts will only effect word stimuli, not pictures or sounds.

Running the Experiment

To run the experiment, first give your subject the instructions for the experiment, or remind yourself what your task and possible key responses are. Then, simply select "run" under the "experiment" menu. You will be shown all of trials in the specified file of trials, with the number of repetitions specified in the "trial details" window. The repetitions will be completely randomized, such that it is possible to get the same trial twice in a row.

The computer will not allow any key presses that are not the correct key press for at least one of the trials. If you need to abort the experiment before it is finished, press the <Escape> key. During the experiment, the computer will keep track of your responses, measuring response times accurately to the millisecond.

The maximum number of trials described in your file of trials is 200, the maximum number of displays per trial is 10, and the maximum number of categories is 26.

After you are finished running the experiment, you will see your results appear in a window such as:

Results for all Category related items:

Responded with y on 1 trials with an average response time of 0.4976 seconds

Responded with n on 0 trials with an average response time of NaN seconds

Number of correct responses = 1, with an average response time of 0.4976

Number of incorrect responses = 0, with an average response time of NaN

Results for all Category unrelated items:

Responded with y on 1 trials with an average response time of 1.1365 seconds

Responded with n on 0 trials with an average response time of NaN seconds

Number of correct responses = 1, with an average response time of 1.1365

Number of incorrect responses = 0, with an average response time of NaN

Results for all Category nonword items:

Responded with y on 0 trials with an average response time of NaN seconds

Responded with n on 2 trials with an average response time of 1.0966 seconds

Number of correct responses = 2, with an average response time of 1.0966

Number of incorrect responses = 0, with an average response time of NaN

Press <RETURN> to Exit

These results break down your results according to the categories specified in the file of trials. For each category of trials, the computer will tell you how often each different key response was made, with the average response time given for the response. The computer will also break down the results more generally into the number of, and response time for, correct and incorrect responses. If there are no results for a particular type of trial, "Nan" will appear as the response time. In addition to showing your results on a window, the computer will save results in a file name specified by the file of experimental results. When you quit the laboratory, you will also have the option to save your results.