A stimulus event is one stimulus and associated parameters that describe one particular presentation of that stimulus. Stimulus event parameters specify things about the stimulus presentation, such as when it occurs. For a complete list of stimulus event parameters, see the stimulus_event Reference page. The definition of a trial object consists of definitions of any trial parameters followed by a list of stimulus events.
#-- SDL excerpt --# trial < trial_duration = forever; trial_type = first_response; picture pic1; time = 1000; code = "pic1"; sound sound1; time = 1500; code = "sound1"; target_button = 1; port_code = 1; >;
In the preceding example, we set two trial parameters. Trial parameters can appear in any order, but they must all precede any stimulus event definitions.
The trial in the preceding example contains two stimulus events. A stimulus event definition must start with a declaration of the stimulus that will be presented. This is followed by any stimulus event parameter definitions. You can define one or many (or no) stimulus event parameters, and they can appear in any order. We discuss most of these parameters in the sections concerning specific features.
It is possible to define a stimulus used in a stimulus event inside a trial definition rather than using a previously named stimulus.
#-- SDL excerpt --# trial < trial_duration = forever; trial_type = first_response; picture < text < caption = "Press the button to continue"; >; x = 0; y = 0; >; time = 0; >;
Stimulus events definitions, however, must occur inside trials. This means that stimulus event parameters cannot occur outside of trials.
#-- SDL excerpt --# picture < bitmap map1; x = 0; y = 0; >pic1; code = "snake pic"; # Oops! Can't assign a code outside a trial trial < . >;
Inside of trials, Presentation assumes that each declaration of a stimulus object signals the beginning of a new stimulus event. Any declaration of a stimulus inside a trial will therefore be interpreted as a new stimulus event. This means that you cannot declare a stimulus for the sole purpose of naming it in a trial description. If you want to do this, you need to do so outside of any trials. In the following example, the trial will contain 2 stimulus events. The picture named pic2 will be presented twice, at 1500 ms and at 3000 ms.
#-- SDL excerpt --# default_delta_time = 1500; default_duration = 1000; begin; . trial < picture < background_color = 0,255,0; >pic2; picture pic2; time = 3000; >;
There is a set of header parameters that allows you to set default values for stimulus events parameters. These values are assigned to stimulus events as soon as a stimulus is declared within a trial. In the last example, Presentation will use the default_delta_time and the default_picture_duration parameters for the first declaration of pic2 . Therefore, pic2 will be shown at time 1500ms as well as time 3000ms. If the intention was simply to name pic2 with the first declaration and only show it once during the trial, this is an error.
Only stimulus declarations may appear inside a trial definition. Declarations of other objects may appear inside those stimulus definitions, but definitions of other objects may only appear by themselves outside of any trial.
#-- SDL excerpt --# bitmap < filename = "my_map.bmp"; >map1; # describe and name map1 wavefile < filename = "my_sound.wav"; >wave1; trial < picture < bitmap map1; # use map1 x = 0; y = 90; >; time = 30; bitmap < filename = "my_map2.bmp"; >map2; # Oops! not allowed here picture < bitmap < filename = "my_map2.bmp"; >map2; # Ok here x = -90; y = 100; > pic2; time = 100; >;
You may use stimuli that are defined and named inside a trial in any other trial.
#-- SDL excerpt --# trial < picture pic1; time = 1000; picture < background_color = 0,255,0; >pic2; # describe, name, and show pic2 time = 3000; >; trial < picture pic2; # reuse pic2 time = 1000; >;
There are three stimulus event properties that may be used to specify the start time for a stimulus event: time, deltat, and delta_time. Each of these properties specifies the time of the stimulus event onset, in milliseconds, relative to something else.
time | stimulus event onset relative to start of the trial containing the stimulus event (Exception: In fMRI mode scenarios, this time can be relative to an input pulse from the scanner) |
deltat | stimulus event onset relative to the actual start time of the immediately preceding stimulus, or, for the first stimulus event in a trial, relative to the start of the trial |
delta_time | stimulus event onset relative to the requested start time of the immediately preceding stimulus, or, for the first stimulus event in a trial, relative to the start of the trial |
The following example uses the first parameter, time:
#-- SDL excerpt --# trial < picture pic1; time = 1000; duration = 5000; sound sound1; time = 1500; >;
When you use the deltat parameter, Presentation will attempt to obtain the time interval between two stimuli, regardless of the actual time of presentation of the first stimulus. If for some reason a stimulus is not presented on time, using deltat for the next stimulus will also delay that stimulus.
#-- SDL excerpt --# trial < picture pic1; time = 1000; # Show 1000 ms after start of trial duration = 500; picture pic2; deltat = 500; # Show 500 ms after pic1 is actually shown duration = 500; picture pic3; time = 3000; # Show 3000 ms after start of trial >;
A second way to indicate times in terms of intervals from previous stimuli is with the delta_time parameter. This parameter is functionally identical to using the time parameter in that Presentation tries to present a stimulus at some time relative to the start of a trial rather than the actual presentation time of the previous stimulus. However, these times are presented as intervals from the requested time of the previous stimulus. This is advantageous because you do not need to know the cumulative time of presentation (relative to the start of the trial).
#-- SDL excerpt --# trial < picture pic1; time = 20; duration = 20; picture pic2; delta_time = 20; # equivalent to 'time = 40' duration = 60; picture pic3; delta_time = 60; # equivalent to 'time = 100' >;
deltat and delta_time are functionally very different. Using deltat or delta_time can produce significant differences in the presentation of your stimuli. The functional difference between deltat and delta_time is most relevant to picture stimuli. For a detailed discussion, see the Picture Timing Control section. For more information about the timing of various stimuli, see the sections for those stimuli.
You may define other parameters after a stimulus declaration. If you don't recognize these parameters now, don't worry. What's important to note at the moment is that the order of these definitions does not matter. You need only define the time parameter before the next stimulus declaration or the end of the trial description.
The following section describes how to synchronize visual and auditory stimuli, or multiple auditory stimuli, with high precision.
Parallel Stimulus Events | How to preschedule sound stimuli in a trial |