Stim

QuickInfo

The Stim column identifies a stimulus to be presented during the trial. For stimuli that are files (e.g., image, sound and text files), DirectRT expects the actual files to be in a "Stim" folder located in the same folder as the input file. If the files are located elsewhere, then the full path needs to be specified. Every Stim column needs a corresponding Loc and Time column.

Values

The following are the different stimulus types allowed in the Stim column. To tell DirectRT which type it is, you need to precede it with an identifying character as follows:

 

Identifier

Stim Type

File Type

Function

none

Image

*.bmp

Displays an image file

!

Sound

*.wav

Plays a sound file

_

Video or Animation

 

Plays any file that can be viewed with the Windows Media Player

~

Text

 

Displays specified text or a blank screen if entered alone.

#

Text File

*.txt

Displays the contents of a text file

&

StimList-Sequential

*.txt

Selects next or specific stimulus from a list

%

StimList-TrueRandom

*.txt

Randomly select stimulus from a list

$

StimList-Random

*.txt

Randomly selects stimulus from a list without replacement

=

Prior Response

 

Presents a prior response of the subject as a stimulus

?

Prior Stimulus

 

Presents a prior stimulus from a specified trial

Image file

To present an image (.BMP) file, simply enter the name of the image file. Images are the default stimulus type so the filenames do not need to be preceded with a special character. Also you do not need to type the ".bmp" following the filename as it is assumed.

Notes about Image Files

! Sound File

To present a sound (standard PCM format .WAV) file, simply enter the name of the sound file preceded by a "!" (e.g., "!mysound"). You do not need to type the ".wav" following the filename as it is assumed. Note that the sound file should be located in the experiment's Stim folder. When using a sound file for a stimulus, you should enter a "0" in the Time column if you want DirectRT to play the sound and proceed immediately to the next stimulus. If you want a delay before the next stimulus occurs, then you should enter the length of that delay in the Time column in milliseconds. To use the default settings for sound files, enter "0,0,0" in the Location column.

Advanced Options

When playing sound files, you cans set options by using values other than "0,0,0" in the Location column. These three options are Frequency, Pan and Volume, respectively. To speed up or slow down the sound file, you can set the frequency in hertz (Hz) at which the sound is played by entering a value from 100 to 100000. To control whether the sound is dominant in the right or left channel, you can set a Pan value anywhere from -100 (left only) to 100 (right only). Finally, to control the volume at which the sound file is played, you can enter a value from 0 (normal) to -100 (completely muted). Sounds can only be reduced in volume and not amplified. Example: To play a wave file at 1500 Hz, in the left ear only, at half volume, you would enter "1500,-100,-50" in the Location column for the sound file stimulus.

Hint

If you have some other form of sound file (e.g., MP3) than a standard PCM formatted .WAV file, you can play it via the Windows Media Player engine by using the same _ symbol used for animations and videos (see below). As with motion image files, anything that will play in the Windows Media Player should be accessible through the _ function.

_ Video / Movie / Animation File

DirectRT will display video (e.g., mpg, avi), animation (e.g., gif) and other files that contain visual motion. It will display them with a high degree of precision in both time and location on the screen. The easiest way to tell if DirectRT will play your file is to open the Windows Media Player (WMP) on your machine and try to run the file--if it plays then it should be fine with DirectRT. Note that newer versions of the Windows Media Player do not support QuickTime. QuickTime Pro converts mov files to avi and mpg if your files are already in this format.

To define a video or animation in your DirectRT session as a stimulus:

1. Copy the media file to your stim folder (recommended but not necessary)

2. Enter the name of the media file in a "Stim" cell

3. Use an underscore "_" to tell DirectRT it's a movie/animation.

4. Define the size of your video window in parentheses after the file name, e.g., (640x480). DirectRT will play the movie at a size of 640 pixels wide by 480 pixels high. You need to specify the movie size explicitly.

Example

If your movie is called "mymovie.mpg" then make sure it's in your stim folder and then refer to it in your input file as "_mymovie.mpg (320x240)"

That's it! You can also position the movie exactly as if it were an image using the location column. "0,0,1" will play it center screen. When applying a style to a trial with video, center alignment tends to work best. You can then take RTs in the time column, again just like it were a picture.

Video Quality Trick

By default, DirectRT runs in 16-bit colour mode. It does this because it gives the program a little extra boost of speed. This is great for text and images but not so great for video. If you're using video and you want the video to look its best, you'll want to run your session in full colour mode (24 or 32-bit).

To do this, create a simple text file called "colour.txt" (yes, the u is necessary :) and copy it to your experiment folder (i.e., the same folder as your input file). In the text file, simply type the number of colour-bits you'd like DirectRT to use. You can use the values 8, 16, 24 and 32. If DirectRT finds your colour.txt file then it will know you want a custom colour depth. If you use 24 or 32 then the video should play in full colour and look really nice. Your system may only support one or the other (i.e., 24 or 32 but not both) so you may have to try each, or check your display settings to see what is allowed.

~ Text

To present a single string of text simply type the actual text you want to display preceded by a "~" Any single word or single line of text can easily be presented in this way. The text will be presented using the colours and font settings associated with the style code for that trial. A blank screen can be presented easily using the ~ symbol on its own.

If you want to present more than a single line of text on the same screen, you can use compound screens (see samples), more simply, you can request a text file instead.

# Text file

To present more than a single line of text on the same screen you can enter the name of a text file to be used as a stimulus. To display the contents of a text file, type the name of the text file preceded by a "#" You do not need to type the ".txt" (it is assumed) although it will not affect anything if you do. Also, you can embed style codes within a single text file for multiple font and colour formats. In the example below, different styles are used for the question wording (style 1), responses (style 2), and page footer (style 3). You can also place style codes in the middle of a line of text (e.g., to change the color or italics of a font). If you do use multiple style within a text file, DirectRT will use the first background colour it encounters (i.e., additional styles will not change the initial screen colour). Text files will always be located starting from the top left corner of the screen. Left and top margins are achieved with spaces and hard returns, respectively.

code1

StimLists

Rather than specifying a specific stimulus, you can opt to request that the stimulus be chosen from a stimulus list. StimLists are text (.txt) files that you create with any text editor that simply list stimuli. This can be especially handy if you want to randomize the stimuli that fill particular positions in your input file (e.g., as opposed to or in addition to randomizing the order of trials-see Randomizing Trials). The list can include any stimuli you could identify normally (e.g., text, images, text files). Just specify all the stimuli the same way you would as if you were entering each directly in the Stim column. For example, the following depicts a simple StimList with a series of Text stimuli:

stimlist1

In the next example, this StimList contains a series of images located in the Stim folder and then two images located in another folder.

stimlist2

Selecting Stim from a StimList

The symbols $, %, and & each indicate a StimList. The difference between them is in how DirectRT selects the stimulus from those listed in the file. The three types of stimulus selection are: Sequential, TrueRandom, and Random.

& Sequential

The & symbol indicates that you want DirectRT to display the first stimulus in the list and then each subsequent stimulus whenever it comes across this StimList again. For example, if you were using the list of animals above, every time you entered &animals in the Stim column of your input file, the next animal in the list would be displayed. If all the stimuli are presented, then DirectRT will begin again from the start of the list.

With the sequential selection type, you also have the option of calling a specific stimulus from the list. To do this, follow the name of the StimList with a ^ and the ordinal position of the stimulus in the list. For example, in the list of animals above, to present "zebra" you would enter &animals^3, or for tiger you would enter &animals^5. Note that doing so sets the sequential position of the file to that chosen item. If you do not specify a specific item the next time you call the file, it will continue from that point.

% TrueRandom

The % symbol indicates that you want DirectRT to display a randomly chosen stimulus from the list. TrueRandom refers to the fact that each time DirectRT chooses a random stimulus it is unconditional. This means that the next stimulus chosen from the list could also have been the last.

$ Random

Finally, the $ symbol indicates that you want DirectRT to randomly choose a stimulus from the list and then take that item out of the running for future selection unless all of the items are first used up. This is how you get randomization without duplicating what is presented or, as it's often called, randomization without replacement. Only if all of the item on the list have been displayed, then DirectRT will re-randomize the list and start again.

Note if for some reason you want to re-set the randomization before all the stimuli have been displayed, the easiest way to do this is to is to call a different StimList with identical stimuli.

Hints

When the stimulus is a file and the file itself is located in a "Stim" folder in the same location as the input file then you can simply enter the name of the file in the Stim column. If the file is located in a subfolder within the Stim folder, then you can enter the name of the subfolder followed by the name of the file (e.g., images\myimage). Otherwise, you need to specify the full path and name of the file you want to present (e.g., c:\mypictures\myimage).

The advantage of placing the stimulus files in the Stim folder (or a subfolder) is that the folder containing the input file(s) and Stim folder can then be moved to a different place and you won't have to worry about checking path names (e.g., c:\..., d:\..., etc.)

Advanced Stimulus Features

= Using a Subject's Response as a Stimulus

Another special case can occur when you want to use the subject's own response as a stimulus. This could happen for example, if the subject were asked to type in a word, and then you wanted to use that word as a stimulus. To present a response as a stimulus, simply use "=" followed by the trial ID in the Stim column. When DirectRT gets to that trial it will substitute the prior response as the new stimulus. You can use the standard operators (e.g., ~, #, $, %, etc.) to indicate what type of stimulus it is, e.g., "~=4" means present the response from trial 4 as text.

For example, on trial 4 the subject enters their name, "George". Later on trial 10, you want to use that response as a stimulus. In the Stim column for trial 10, you could enter "~=4". This would tell DirectRT to present the response from trial 4 as a text stimulus on trial 10.

See sample: open ended responses as stimuli in the "other features" sample folder

If you want to get really fancy with this, you can name image, sound, and stimlist files with the possible responses to a question and then have them presented using this feature. For example, if the possible responses to trial 4, are "a", "b" and "c", you could create stimlists called "a.txt", "b.txt" and "c.txt". Then later if you specified a stimulus as "$=4", DirectRT would substitute the response here from trial 4. So if the subject had responded with "b" to question 4, using a later stim value of "$=4" would mean "$b", in other words, randomly select a stimulus from stimlist "b.txt". The same logic applies to all file types that you can specify as a stimulus.

? Using Randomly Selected Stimuli Again

In special cases you might want to instruct DirectRT to use a stimulus from a previous trial without knowing exactly what that stimulus will be when you design your input file. This could happen for example, when a stimulus is randomly determined on one trial but then you want to repeat that trial. On the later trial you can simply tell DirectRT which stimulus you want to repeat. Essentially saying, "use the third stimulus from block 2, trial 5--whatever it was!" To do so, you can use the "?" operator which means to use a previous stimulus, no matter whether it was randomly chosen or not. To refer to a previous stimulus, you just need to know the block (b), trial (t) and stimulus (s) ID. For example if you want to use block 1, trial 3, stimulus 4 in a later trial, you would request: "?b1t3s4" in the stim column.

See sample: using previous stim in the "other features" sample folder

ttl Sending Synchronized TTL Signals to External Equipment

In order to communicate with external equipment (e.g., physiological equipment, response boxes, other computers), you can send and receive TTL (Transistor-Transistor Logic) signals through any of your computer's accessible ports (e.g., parallel or serial ports). In English, this means you can ask DirectRT to send a value from 0-255 to your external equipment any time you like, and/or you can have DirectRT wait for any value from 0-255 to come from the external equipment. To accomplish sending a value, you list a TTL signal just like any other stimulus in the Stim column of your input file. See the example below. We indicate that we want a TTL signal to be sent by entering "ttl:n" in the Stim column where n is the byte value from 0-255 that we want to send. We enter the port ID in the Loc column (e.g., 888 is usually the LPT1 parallel port). Finally, we enter a 0 in the Time column if we want to send the value and forget about it. Alternatively, we could specify the number of milliseconds here that we want the signal to be sent before setting the port back to its origional state.

So what happens in this example? On each of these trials, DirectRT will send the value (e.g., 2, 3, 4 or 5) to port 888 and then immediately proceeds with the next stimulus. Any external equipment that can read the byte value located at port 888 will now be able to know precisely when DirectRT displayed each of the subsequent stimuli.

of_ttl

See sample: TTL Signals in the "other features" sample folder

For details on receiving TTL signals for response times, see the TTL signals sample.

See also

Loc - Stimulus Location

Time