Getting started / Making an experiment

How to…

Varying element properties in real time

Many elements are dynamic by their nature (e.g. movie elements). However, you can also more generally change the value of some element properties in real time when the element is running. Do this using property vary, which all elements have. Then instead of you setting the target property, PsychBench will vary it on a time-dependent course using any expression you set.

Staircases

In a staircase experiment a staircase value (a number) carried across trials determines some stimulus parameter at each trial. Staircase value can then step up or down for the next trial based on whether response from subject was correct, making the task harder (correct) or easier (incorrect) and so adapting to the subject’s threshold.

In PsychBench you can run a staircase experiment by staircasing properties of elements. For each element to staircase, list one or more target properties in property staircase, which all elements have. Then instead of you setting the target property, PsychBench will set it based on the value of the staircase when the trial containing the element runs. You also need a single staircase object to carry and step the staircase value across trials. There are different staircase object types allowing for different methods, e.g. fixed step, QUEST. The usual approach is to apply the staircase to the same property of a similar stimulus element in each trial. You can staircase elements independently or relative to other elements. You can also run multiple staircases consecutive or interleaved using multiple staircase objects. See staircase examples at www.psychbench.org/docs#demos.

Method of adjustment

In a method of adjustment experiment the subject adjusts one or more stimulus parameters in real time, typically to match their threshold for the task. In PsychBench you can run an adjustment experiment by allowing the subject to adjust some properties of elements when they are running. To do this use an adjuster element to receive input from the subject and adjust the target element based on it (e.g. left arrow key → +10). There are various adjuster element types allowing for different methods, e.g. key press, mouse click & drag, etc.

Scanners, Triggers

Generally in scanner experiments the experiment sends a signal to or receives a signal from the scanner to synchronize with it. The experiment and scanner then run independently but in sync. In some designs multiple (or all) trials run from a sync. In other designs the experiment re-syncs in each trial and timing within the trial goes from that.

In PsychBench use an element that sends/receives signals to register a signal as a trigger. For example, use a portSender/Receiver element. You can also use any response handler element (most commonly keyPress) as a receiver if you set its property registerTrigger = <cd>true<cd> to register input as triggers. Whatever element you use, set its property syncExperiment = <cd>true<cd> to sync the experiment at the trigger. This allows you to set any elements in the trial to start/end at times relative to sync using properties start/end field t_sync for them. You can also set subsequent trials to start at times relative to sync using trial object property start field t_sync. See scanner examples at www.psychbench.org/docs#demos, including an example with jittered inter-trial intervals.

See also screen object properties flipHorz/flipVert, which may be useful if you are showing stimuli through a mirror.

Stereo display

PsychBench can do stereo display using all the modes available in Psychtoolbox. These range from anaglyph to stereo hardware. Turn on stereo display by adding a screen object and setting its property stereo = <cd>true<cd>. For any visual element you can then set whether it shows on left/right/both eyes using property nn_eyes. Some elements also have specialized stereo display options—see the element type documentation. For an example see <><PsychBench folder><>/docs/stereoDemo.