Introduction and Key Concepts

DirectRT or MediaLab?

Many users ask us if they should use MediaLab, DirectRT or both. Whether you use one or both depends on what your needs are. MediaLab's strength is in its flexibility and ease-of-use with respect to traditional self-report questionnaires (many closed and open-ended question formats) and multi-media stimuli (movies, sound, html, word documents, powerpoint shows, etc.). You can use its point-and-click interface to quickly create an attractive questionnaire or experiment. It also creates data files in a horizontal (one row per subject) format that are very easy to work with and ready to analyze in Excel or SPSS.  All of MediaLab's multi-media flexibility requires that it be a traditional Windows program, meaning that the any measures of display and response timing are also subject to the variations of the Windows operating environment. Thus, projects involving tasks like cognitive/perception trials (e.g., priming/lexical decision style tasks) that require measures of stimulus presentation and response times reliable and accurate to the millisecond are not as well-suited to MediaLab.

This is what DirectRT is excellent for.  You get total control over timing because it's a DirectX application and not a "Windows" program. Basically, it was created to do what MediaLab can't do well–high precision cognitive/perception, "blocks of trials" types of tasks. You define your trials in a spreadsheet (e.g., Excel) so you can use your favourite spreadsheet app for editing the input files (a very nice benefit). Due to the nature of DirectRT experiments, the data files are vertical (e.g., one row per trial). This means it takes a bit more skill to collapse and analyze the data. Although some tasks could be easily done with either program, one or the other is usually a clear choice.

Both programs are stand alone, but they do work very well together as complements. A lot of people use both and embed DirectRT sessions within a more general MediaLab experiment. That's the gist of the difference.

Timing is Everything

DirectRT is all about timing. Windows is generally a very chaotic environment to work in when it comes to controlling the timing of events. This is a primary reason why Microsoft introduced DirectX, a software development platform that provides programmers with direct access to your computer's hardware. Commonly used for the development of high-end 2 and 3D graphics applications and video games, DirectX provides a programming environment ideally suited for the rigorous demands of computerized psychological experimentation. For our purposes, the most important element of DirectX is DirectDraw--a system allowing direct access to your computers display hardware. What this means essentially is that the timing of what you see on the screen and when you see it can be controlled with great precision.

Screen Refresh Rate

Refresh Rate is one of the most fundamental concepts in high precision computerized experimentation. The screen refresh rate refers to how long it takes your computer to redraw what you see on the monitor. It is often expressed in Hz (e.g., 60Hz, 100Hz) which refers to the number of times your screen is refreshed (or redrawn) in a single second. This can easily be converted to milliseconds by dividing it into 1000, e.g., 60Hz = 1000/60 = 16.67ms per refresh; 100Hz = 1000/100 = 10ms per refresh. Why is this so critical?

Because everything DirectRT displays will be in multiples of the refresh rate and in perfect synch with the refresh rate. For example, if your refresh rate is 10ms, then DirectRT can display stimuli for 10ms, 20ms, 30ms, 40ms, 2000ms, or 2010ms, etc. So if you have a 15ms refresh rate and you want to show a stimulus for 12ms? Forget about it! 0, 15, 30, 45, 60… get the idea? Fortunately you don't have to worry much about this. You can ask DirectRT to display stimuli for any amount of time you like. Based on your refresh rate, DirectRT will display your stimulus for as many screen refreshes as it takes to come closest to your requested display time and will create a log data file for you so that you can compare requested against actual presentation times. See Screen Size for additional detail.

The Input File

The next great truth - to run a DirectRT session, you need an input file. This file will tell DirectRT what to present as well as where and when to present it and when to take reaction times. So how do you create an input file?

Use Your Spreadsheet Skills!

A key DirectRT concept is that you create an input file using whatever spreadsheet application you are most comfortable with. If you know how to work with a spreadsheet in Excel or other application then you already know how to edit DirectRT input files. When you're done creating or editing your input file, you simply select Save As from the file menu of your spreadsheet application and save your input file in the .CSV format (comma-delimited).

The appeal of the .CSV format is that anybody can edit any DirectRT input file with any spreadsheet editor and then save it in this common format. This way no one has to learn how to use a new editing program for creating their input files. Everyone can use the spreadsheet application they already know best.

Structure of an Input File

When DirectRT reads your input file, it reads each row of your spreadsheet as a "trial." Because a spreadsheet can have as many rows as you like, you can put as many trials as you like in your input file. Just remember each row is a trial.

For each trial there are a few initial columns in which you specify general information about that trial, such as block and trial IDs, what experimental condition(s) the trial belongs to, how it's supposed to be randomized and so forth. But then comes the really powerful and fun part about DirectRT-Screens!


For each trial, your input file tells DirectRT to create a series of 'screens'. A screen refers to what is supposed to be displayed on the monitor at a given time. This might be a stimulus word, some formatted instructions in a text file, a precisely located image, a full screen full color image, a sound, a movie, an animation, or any combination of these. Before a trial begins, DirectRT thinks briefly but intensely about the trial, creates the screens as you have specified, holds them all in memory and then flips through them - displaying each for the number of screen refreshes that best approximates the amount of time you've requested.

This sounds like it might be complicated, but it's actually quite easy once you've seen it in action. Creating a new screen for a trial is easy. You simply add 3 new columns to your input file: Stim, Loc, & Time. In the Stim (short for Stimuli) column, you enter what you want to appear on the screen. In the Loc (short for Location) column, you specify where you want it placed and whether you want it to be added to or replace the previous screen. DirectRT is very flexible in terms of creating screens-either from single or multiple stimulus sources. Finally, in the Time column, you specify how long the screen is to be displayed (in milliseconds) before DirectRT flips to the next screen in your trial. In the Time column you can also indicate that a response time is requested rather than automatically proceeding.

That's it. 3 columns-Stim, Loc, & Time. Remember this and you're set! You just keep adding a new set of three columns labeled with these same headers until your trial has been specified. Some trials might have only 1 or 2 sets, others may have 5, 10 or more. One appeal of this method is that it's very easy to create basic trials in just a few minutes. However, it will become apparent that with a few easy tricks you can also create very elaborate trials with minimum effort.


To save time, you can store font, color, alignment and miscellaneous RT information in a Styles (.DRT) file. Combinations of such variables can be created and saved with a single style code. One of the initial columns of the input file is the Style column-this is where you tell DirectRT which of your styles from your Styles (.DRT) file you want to apply to the trial. You can drop a copy of any Styles file into the folder that contains your input file, modify as you like, and DirectRT will automatically use it when running your session. If you don't do this, then DirectRT will simply access the default Styles file located in the main DirectRT program folder--'styles.drt'.

Running an Input File

By this point your work is done. You simply need to run the input file. There are three ways to do this. The easiest is to run DirectRT.exe--there should be a shortcut icon for it located on your desktop if you chose this option during the installation of DirectRT. From the file menu, select "Select and run input file," or hit Ctrl-S. Find and select your input file and then enter a subject and condition ID (these are for your own tracking purposes) and press OK. To stop a session early, press "Esc" and the session will end and the data up that point will be saved.

You can also run your input file from MediaLab. Simply select "DirectRT Session" as a questionnaire item and enter the input file in the File field. MediaLab will pass the current subject and condition IDs to DirectRT, launch the session, and then resume where it left off when the session has completed. It is strongly recommended that you insert at least one MediaLab item (e.g., a basic instruction screen) between any DirectRT sessions you have right next to each other in a MediaLab file just to give each session enough time to start and finish.

Finally, you can run an input file from any program or batch file using a command prompt.

Viewing the Data

Just like input files, DirectRT uses the comma delimited or .CSV format for data or "output" files. This means you can view and edit the data again using your favorite spreadsheet application such as Excel. All data are written to a "Data" folder stored in the same location as the input file. If this is not possible (e.g., the input file is on a CD-ROM), then it will be written to the "Data" folder located in the main program folder. You can select "Open Output File" from the main menu in DirectRT or find and select the file from Windows Explorer (which you can also launch from the main menu).

Note that there are two data files produced for each input file. One is a short version and the other is a longer more detailed log version. The shorter one will usually do for most purposes and is easier to deal with. However, when you want detailed information on each trial including the actual time each stimulus was presented for each trial etc., then the longer version can be found in the "Log" subfolder.


A variety of samples have been included to illustrate the various capabilities of DirectRT. These input files are located in the "Samples" folder of the main DirectRT program file folder. Try running each of these samples and then look at the input file to see how it was done.

Good luck and thanks for trying DirectRT!