PsyToolkit
Menu PsyToolkit main menu Welcome Introduction How it works Scripting basics Stimulus presentation Timing precision Examples Script syntax Script references Java Psylib references PsyQuest Problem solving Special devices FAQ Download / Installation Resources Contact Acknowledgments Complete PDF manual
Translations Deutsch Français Español 中文 日本語 한국어 Русский
principles


How PsyToolkit generally works

The information below is mostly aimed at people who want to know some of the mechanisms behind PsyToolkit. If you merely wish to learn the scripting language, you can skip this.

PsyToolkit has two different ways to create an experiment:
  1. Using the scripting language. This is the easiest and recommended way.
  2. Using the C library. There are few situation where you would need this.
If you use the scripting language, the computer will actually create C code itself, and this C code is then compiled into an executiable Linux programme. You can even have a look at the C code yourself, and modify it (use the -k option to keep files).

Please note: PsyToolkit helps you to create executable files, which are based on C code. Thus, even though PsyToolkit uses a scripting language, PsyToolkit is not an interpreted language, because interpretation is not done at the time of execution. PsyToolkit does not have some of the potential disadvantages associated with interpreted languages for time-sensitive projects.

The scripting language

The scripting language is sufficient for many experiments. If it is still not flexible enough for your objectives, you can code your experiment directly with in C, using the psylib library.

Here are the steps you would take to go from an idea of an experiment to running it: The figure below shows the idea of translating the scripting code into C code, which get translated into an executable (this is only technical background information, you do not need to know this as a user).

psycc


These are the steps:

The psylib library

If the scripting language cannot satisfy your needs, you can use the psylib in C code. Currently, the scripting language is so powerful, that it is most likely that you can use the scripting language (you can even use the C language within the script in a very simple way; this can be very handy for using mathematical and logical functions).

In order to use the C library or C calls in a script, you must know the C language. All library functions are explained elsewhere in this documentation.