Skip to content

Useful functions

roelandheerema edited this page Feb 23, 2023 · 8 revisions

The OTG toolbox includes a few functions that are typically useful for any Psychtoolbox-based experiment:

  1. Fixation cross with BEC_Fixation puts a fixation cross on screen of which the visual appearance is controlled in the exp_settings structure. The participant has the opportunity to leave the experiment while the fixation cross is on screen by pressing ESCAPE.

  2. Monitor a specific keypress with BEC_WaitForKeyPress. Enter the name of one or more keys, and the function will only output when the selected key or keys are pressed. It also has an arbitrary timeout time if no keys are pressed for a very long time.

  3. Show instruction figures with BEC_InstructionScreens. You can store images in the Stimuli folder - currently there are example instruction slides from BEC_Master_Emotion that were made in PowerPoint and saved as .PNG figures. This function creates a screen and puts the slides on screens. You enter either the names of the instructions (as specified in exp_settings) or you simply enter their numbers. Often, you will want to show multiple slides, say slides 5 to 8. This function allows the participant to browse back and forth through these slides with the arrow keys, avoiding that they accidentally press a key before having fully read an instruction.

  4. Adjust volume with BEC_SetVolume. This function will allow you to present sound stimuli at a percentage (max: 100%) of the computer's set volume level. Note that although the percentage increases or decreases linearly with the amount of arrow up/arrow down key presses, the actual increase/decrease follows a logarithmic function. This function is used in emotion induction experiments where the volume for music stimuli must be set prior to the experiment. The outputted volume is used whenever music is played.

Clone this wiki locally